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

# Get single image classification result

> Retrieve the classification result for a specific image.

**Note:** This endpoint also has an alias available at `/api/classification_image/{identifier}`.



## OpenAPI

````yaml get /api/classification/{identifier}
openapi: 3.0.0
info:
  title: identifAI API
  version: 1.0.0
  description: >-
    API for integrating identifAI's image and video classification
    capabilities.<br><details><summary>**How to obtain your API
    Key**</summary>To obtain your API key, follow these simple steps:  
    <ol><li><p>**Create a user profile and log in to the platform**</p>If you
    don't have an account yet, visit our platform and create a user profile.
    Once you've completed registration and verified your email, log in with your
    credentials.</li><li><p>**Access the user menu**</p>After logging in, click
    on your name or the user icon in the top-right corner of the
    screen.</li><li><p>**Select the API Key option**</p>In the dropdown menu
    that appears, select the "API Key" option. From there, you can view or
    generate your API key.</li></ol>Now you are ready to use your API key in our
    API!</details><details><summary>**How to use the API**</summary>To use the
    API, first make a **POST** request to start the classification. Then, use
    the provided ***identifier*** from the **POST** request to retrieve the
    results.

    <details>

    <summary>**1. Image Classification**</summary>
      * To classify an image, you need to make a **POST** request to `/api/classification` with the required parameters (for details on the parameters, refer to the *"Classification"* section below).
      * In the response, you will receive the ***identifier*** of the classified image.
      * Use the provided ***identifier*** to retrieve the classification results by making a **GET** request to `/api/classification/{identifier}` (for details on how to structure this request, see the *"Classification"* section below).
      * The response will contain the classification results for the image in JSON format.<br>In the response, you will find a ***results*** array, which includes the classification results for each model used, and a ***verdicts*** array, which contains the results for each heuristic applied.<br>If the classification is not yet complete, continue sending the **GET** request until the result is available.</details><details><summary>**2. Video Classification**</summary>
        * To classify a video, you need to make a **POST** request to `/api/classification_video` with the required parameters (for details on the parameters, refer to the *"Classification"* section below).
        * In the response, you will receive the ***identifier*** of the classified video.
        * Use the provided ***identifier*** to retrieve the classification results by making a **GET** request to `/api/classification_video/{identifier}` (for details on how to structure this request, see the *"Classification"* section below).
        * The response will provide the classification results for the video in JSON format. For video classification, the video is divided into *frames*.<br> In the response, you will find a ***results*** array that includes the classification outcomes for each model applied to each analyzed frame, and a ***verdicts*** array containing the results for each heuristic used.<br> If the classification is not complete, continue sending the **GET** request until the final results are returned.</details><details><summary>**3. All Classifications**</summary>The `/api/classifications` endpoint will return all the image classifications made by a user. This will list the results of all past image classification requests.</details><details><summary>**4. User Management**</summary>  The **POST** `/api/user` endpoint allows you to create a user, while the **DELETE** `/api/user` endpoint is used to delete a user (For the structure of the requests, see more in the user section below).</details></details>
servers:
  - url: https://backend.identifai.net
security: []
tags:
  - name: Classification
    description: Classification routes
  - name: User
    description: User actions
  - name: Partner
    description: Partner actions
paths:
  /api/classification/{identifier}:
    get:
      tags:
        - Classification
      summary: Get single image classification result
      description: >-
        Retrieve the classification result for a specific image.


        **Note:** This endpoint also has an alias available at
        `/api/classification_image/{identifier}`.
      parameters:
        - name: identifier
          in: path
          required: true
          schema:
            type: string
          description: The identifier of the image.
      responses:
        '200':
          description: The classification result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              example:
                error: Unauthorized
        '403':
          description: >-
            The user is not authorized to access this API or did not accept the
            terms of service.
          content:
            application/json:
              example:
                error: Forbidden
        '429':
          description: Too many requests.
          content:
            application/json:
              example:
                message: Too Many Attempts.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ImageResponse:
      type: object
      description: The answer for image classification
      properties:
        hash:
          type: string
          description: SHA-256 hash of the classified image file
        identifier:
          type: string
          description: The identifier that identifies the classified image
        api_version:
          type: string
          nullable: true
          description: >-
            The API version at the time of the analysis (available from
            **v1.1.0**). The value is set when the analysis completes.
        status:
          $ref: '#/components/schemas/Status'
          description: >-
            The processing status of the classification request (available from
            **v1.1.0**)
        errors:
          type: string
          nullable: true
          description: >-
            Error messages if the status is 'errored' (available from
            **v1.1.0**)
        name:
          type: string
          description: The name of the classified image file
        ref_id:
          type: string
          description: >-
            An optional reference ID to associate with the classification
            request.
        result_url:
          type: string
          format: uri
          description: URL where the classification results can be found on the dashboard
        is_nsfw:
          type: boolean
          nullable: true
          description: >-
            Indicates if NSFW (Not Safe For Work) content was detected. Only
            present if with_nsfw was set to true in the classification request.
        c2pa:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/C2PA'
          description: >-
            Coalition for Content Provenance and Authenticity information that
            certifies the source and history of media content. Contains
            manifests, validation results, and signature information. Null if
            the image doesn't contain C2PA metadata.
        has_heatmap:
          type: boolean
          description: >-
            If the image has an AI content heatmap. The heatmap png can be
            retrieved from the specific endpoint
            `/api/classification/heatmap/{identifier}`.
        verdict:
          $ref: '#/components/schemas/Verdict'
          description: The main classification verdict using the user's default heuristic
        verdicts:
          type: array
          items:
            $ref: '#/components/schemas/Verdict'
          description: Array of verdicts for all available heuristics
        force_classification:
          type: string
          enum:
            - human
            - artificial
          nullable: true
          description: >-
            If present, indicates that the user has forced the classification to
            the specified value
        results:
          type: array
          items:
            $ref: '#/components/schemas/Result'
          description: Detailed classification results from each AI detection model
        details:
          type: array
          items:
            $ref: '#/components/schemas/ObjectDetails'
          description: Details about object detection inside the image
    Status:
      type: string
      enum:
        - new
        - done
        - errored
    C2PA:
      type: object
      properties:
        manifests:
          type: object
          description: >-
            Dictionary of C2PA manifests, keyed by manifest URN. Each manifest
            contains information about the content's creation and modification
            history.
          additionalProperties:
            type: object
            properties:
              label:
                type: string
                description: URN identifier for this manifest
              title:
                type: string
                description: Human-readable title of the manifest
              assertions:
                type: array
                description: List of cryptographic assertions about the content
                items:
                  type: object
                  properties:
                    label:
                      type: string
                      description: Type of assertion (e.g., 'c2pa.actions.v2')
                    data:
                      type: object
                      description: Assertion data content
              ingredients:
                type: array
                description: List of source materials used to create this content
                items:
                  type: object
                  properties:
                    label:
                      type: string
                      description: Type of ingredient
                    title:
                      type: string
                      description: Name of the ingredient
                    format:
                      type: string
                      description: File format of the ingredient
                    relationship:
                      type: string
                      description: Relationship to the parent content (e.g., 'componentOf')
                    active_manifest:
                      type: string
                      description: URN of the ingredient's active manifest
                    validation_results:
                      type: object
                      description: Validation results for this ingredient
              instance_id:
                type: string
                description: XMP instance ID
              signature_info:
                type: object
                description: Information about the cryptographic signature
                properties:
                  alg:
                    type: string
                    description: Signature algorithm used (e.g., 'Es256')
                  issuer:
                    type: string
                    description: Certificate issuer
                  common_name:
                    type: string
                    description: Common name from the certificate
                  cert_serial_number:
                    type: string
                    description: Certificate serial number
              claim_generator_info:
                type: array
                description: Information about the software that generated the claim
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of the claim generator software
        active_manifest:
          type: string
          description: URN of the currently active manifest
        validation_state:
          type: string
          enum:
            - Valid
            - Invalid
            - Unknown
          description: Overall validation state of the C2PA data
        validation_status:
          type: array
          description: List of validation status messages
          items:
            type: object
            properties:
              url:
                type: string
                description: URN or URL of the validated element
              code:
                type: string
                description: Validation status code
              explanation:
                type: string
                description: Human-readable explanation of the validation result
        validation_results:
          type: object
          description: Detailed validation results
          properties:
            activeManifest:
              type: object
              properties:
                failure:
                  type: array
                  description: List of validation failures
                  items:
                    type: object
                success:
                  type: array
                  description: List of successful validations
                  items:
                    type: object
                informational:
                  type: array
                  description: Informational validation messages
                  items:
                    type: object
            ingredientDeltas:
              type: array
              description: Validation deltas for ingredients
              items:
                type: object
    Verdict:
      type: object
      description: The final classification response for the considered heuristic
      properties:
        models:
          type: array
          items:
            type: string
            description: Model name
          description: Array of models used
        heuristic:
          type: string
          description: >-
            Name of the heuristic used (e.g., 'Majority', 'Average',
            'AverageExcludeObsolete', 'TopRelevant')
        confidence:
          type: number
          description: The confidence of the classification result from 0 to 1
        classification:
          type: string
          enum:
            - human
            - artificial
          description: The final classification result using the specified heuristic
      required:
        - heuristic
        - confidence
        - classification
    Result:
      type: object
      description: >-
        The score obtained in each category (human or artificial) for the model
        used
      properties:
        model:
          type: string
          description: The name of the AI detection model used for classification
        unknown:
          type: boolean
          description: >-
            Indicates if the model couldn't confidently classify the image
            (uncertainty detected)
        elapsed_time:
          type: number
          description: The time taken for classification in seconds
        classification:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
                description: Category
                enum:
                  - human
                  - artificial
              score:
                type: number
                description: Score from 0 to 1
          description: Array of classification scores for each category
        classification_details:
          type: object
          description: Additional details about the classification process
    ObjectDetails:
      type: object
      properties:
        detections:
          type: array
          items:
            type: object
            properties:
              box:
                type: object
                properties:
                  x1:
                    type: number
                  x2:
                    type: number
                  y1:
                    type: number
                  y2:
                    type: number
                required:
                  - x1
                  - x2
                  - y1
                  - y2
              results:
                type: array
                items:
                  type: object
                  properties:
                    model:
                      type: string
                    unknown:
                      type: boolean
                    elapsed_time:
                      type: number
                    classification:
                      type: array
                      items:
                        type: object
                        properties:
                          label:
                            type: string
                          score:
                            type: number
                        required:
                          - label
                          - score
                    classification_details:
                      type: object
                      properties:
                        confidence:
                          type: number
                      required:
                        - confidence
                  required:
                    - model
                    - unknown
                    - elapsed_time
                    - classification
                    - classification_details
              verdict:
                type: object
                properties:
                  heuristic:
                    type: string
                  confidence:
                    type: number
                  classification:
                    type: string
                required:
                  - heuristic
                  - confidence
                  - classification
            required:
              - box
              - results
              - verdict
      required:
        - detections
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: Your API key.

````