Skip to main content

Update Custom Model

Update a custom model's metadata.

Endpoint

PUT /api/v3/custom_models/{id}

Path Parameters

ParameterTypeRequiredDescription
idnumberYesModel ID

Request Type

type UpdateModelBody = {
name: string;
language_id: number;
organization_id: number;
};

Request Fields

FieldTypeRequiredDescription
namestringYesModel name
language_idnumberYesLanguage identifier
organization_idnumberYesOrganization identifier

Response Type

Wrapped in:

type BaseResponse<T> = {
// Response wrapper structure
};

Notes

  • Uses optimistic updates for immediate UI feedback
  • Previous query data is cached and restored on error
  • Invalidates related queries on success:
    • Model detail query for the updated model
    • All list queries to refresh the updated model
    • Model data queries
  • Returns error toast on failure with detailed validation messages
  • All three fields (name, language_id, organization_id) are required

See Data Models for complete schema reference.