> ## 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.

# Create or update user

> Creates a new user or updates an existing one. Partners can only create or update users under their partnership.



## OpenAPI

````yaml post /api/partner/user
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/partner/user:
    post:
      tags:
        - Partner
      summary: Create or update user
      description: >-
        Creates a new user or updates an existing one. Partners can only create
        or update users under their partnership.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  nullable: true
                  description: >-
                    The ID of the user (required only for updates, `null` for
                    creation).
                name:
                  type: string
                  description: The full name of the user.
                email:
                  type: string
                  format: email
                  description: The email address of the user.
                password:
                  type: string
                  format: password
                  description: The password for the user.
                heuristic:
                  type: string
                  description: The euristic assigned to the user.
                pricing_id:
                  type: integer
                  description: The pricing tier ID for the user.
                readonly:
                  type: boolean
                  description: Indicates whether the user has read-only permissions.
                newsletter:
                  type: boolean
                  description: True if the user has opted in for the newsletter.
                save_files:
                  type: boolean
                  description: True if the user can store submitted files.
              required:
                - id
                - name
                - email
                - heuristic
                - pricing_id
      responses:
        '200':
          description: Created or updated user
          content:
            application/json:
              example:
                data:
                  id: 233
                  name: UserName
                  email: UserName@mail.com
                  email_verified_at: '2025-03-12T11:30:25.000000Z'
                  address: null
                  zip: null
                  city: null
                  country: null
                  phone: null
                  contact: null
                  vat: null
                  created_at: '2025-03-12T11:30:25.000000Z'
                  updated_at: '2025-03-12T11:30:25.000000Z'
                  balance: null
                  heuristic: AverageExcludeObsolete
                  readonly: null
                  pricing:
                    id: 1
                    name: TestB
                    sku: testB
                  partner:
                    id: 221
                    name: PartnerName
                    email: PartnerName@mail.com
                    email_verified_at: '2025-03-03T11:22:49.000000Z'
                    address: null
                    zip: null
                    city: null
                    country: null
                    phone: null
                    contact: null
                    vat: null
                    created_at: '2025-03-03T11:22:49.000000Z'
                    updated_at: '2025-03-03T13:27:06.000000Z'
                    balance: 0
                    heuristic: Average
                    readonly: false
                    pricing:
                      id: 2
                      name: TestAC
                      sku: testAC
                    partner: null
              schema:
                $ref: '#/components/schemas/User'
        '401':
          description: Invalid or missing API key
        '429':
          description: Too many requests.
          content:
            application/json:
              example:
                message: Too Many Attempts.
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier of the user.
        name:
          type: string
          description: Full name of the user.
        email:
          type: string
          format: email
          description: Email address of the user.
        email_verified_at:
          type: string
          format: date-time
          description: Timestamp when the email was verified.
        address:
          type: string
          nullable: true
          description: User's address.
        zip:
          type: string
          nullable: true
          description: Postal code of the user.
        city:
          type: string
          nullable: true
          description: City of the user.
        country:
          type: string
          nullable: true
          description: Country of the user.
        phone:
          type: string
          nullable: true
          description: Phone number of the user.
        contact:
          type: string
          nullable: true
          description: Alternative contact information.
        vat:
          type: string
          nullable: true
          description: VAT number of the user, if applicable.
        created_at:
          type: string
          format: date-time
          description: Creation timestamp of the user.
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp of the user.
        balance:
          type: number
          description: The user credits balance.
        heuristic:
          type: string
          description: User's heuristic setting.
        readonly:
          type: boolean
          description: User can only view classification results.
        pricing:
          $ref: '#/components/schemas/Pricing'
          description: User pricing plan.
        partner:
          $ref: '#/components/schemas/User'
          description: User partner.
    Pricing:
      type: object
      properties:
        id:
          type: integer
          description: The id of the pricing plan.
        name:
          type: string
          description: Name of the pricing plan.
        sku:
          type: string
          description: SKU code associated with the pricing plan.

````