how throw a custom exception in JSONAPI?
thanks  @4k4, I solved it using customs constraints in my custom entity, JSONAPI mapping well the error and the admin UI works perfectly with that.
like @kiamlaluno said, i try to explain the solution using constraints:
I want to response in the JSONAPI Request that the content is already exists but with a different code, no 500. So when i use constraints i can validate if content already exist or not and response if is a valid request (TRUE / FALSE), this constraints works in the JSONAPI Responses and in the Drupal Admin UI.
So you need to define the constraint in the folder
&quot;my_module/src/Plugin/Validation/Constraint&quot; and create 2 files, for my example i need that the content is unique. so my files are:
UniqueProfileContentConstraint.php
&lt;?php

namespace Drupal\my_module\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Plugin implementation of the 'unique_entry_constraint'.
 *
 * @Constraint(
 *   id = &quot;unique_profile_content_constraint&quot;,
 *   label = @Translation(&quot;Unique entry constraint&quot;, context = &quot;Validation&quot;),
 * )
 */
class UniqueProfileContentConstraint extends Constraint
{

    // The message that will be shown if the value is not unique.
    public $notUnique = 'This content already exists';

}

And the validator:
UniqueProfileContentConstraintValidator.php
&lt;?php

namespace Drupal\ztv_content\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

/**
 * Validates the UniqueInteger constraint.
 */
class UniqueProfileContentConstraintValidator extends ConstraintValidator
{

    /**
     * {@inheritdoc}
     */
    public function validate($entity, Constraint $constraint) {
      // Next check if the value is unique.
      if (!$this-&gt;isUnique($entity)) {
          $this-&gt;context-&gt;addViolation($constraint-&gt;notUnique);
      }
    }

    private function isUnique($entity)
    {
      if ($entity-&gt;isNew()) {
        $query = \Drupal::entityQuery('profile_content_entity')
          -&gt;condition('profile_id', $entity-&gt;get('profile_id')-&gt;getString())
          -&gt;condition('video_id', $entity-&gt;get('video_id')-&gt;value);
        $storageContent = $query-&gt;execute();
        if ($storageContent) {
          return FALSE;
        }
        return TRUE;
      }
    }

}

And finally in the Entity annotation you need to add the id of your constraint:
 *   constraints = {
 *      &quot;unique_profile_content_constraint&quot; = {}
 *   }
 * )
 */