Skip to content

Pet Profiles API Overview ​

This page collects the shared conventions, data objects, and validation rules for pet profiles. The complete request, complete response examples, and field descriptions for each endpoint are on the corresponding endpoint page.

Basics ​

Gateway base URL:

text
https://open-api.habitaxx.com/v1/ms-ai-fast

Request headers ​

http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

Content-Type is required only when a request body is present.

Unified JSON response ​

json
{
  "code": 200,
  "message": "success",
  "data": {}
}
FieldTypeDescription
codeinteger200 on success; on failure a business error code that matches the HTTP status.
messagestringStatus text: always "success" on success (normalised by the gateway) and a safe Chinese message on failure. Do not use it for program logic.
dataanyBusiness data; the structure and content vary by endpoint.

List endpoints do not return pagination metadata

List endpoints accept page and limit, but the response body only contains code, message and data — there is no page_info, total or total_pages. Count results on your side, or treat a page whose length equals limit as "there may be more".

Endpoint overview ​

EndpointMethodReturnsPurpose
/pets/pet-infoGETBreed cataloguePrerequisite: look up the standard breed library to obtain the breed_code used when creating or updating a profile.
/pet-profilesPOSTA single profileCreate a pet profile.
/pet-profilesGETdata is an array of profilesList profiles with pagination.
/pet-profiles/{pet_profile_id}GETProfile + recordsRetrieve a profile.
/pet-profiles/{pet_profile_id}PATCHThe updated profilePartially update a profile.
/pet-profiles/{pet_profile_id}DELETE{"id": 44}Soft-delete a profile.

Data object: PetProfile ​

FieldTypeWritableDescription
idintegerNoPet-profile ID, generated by the platform after creation.
namestringYesPet name, required on creation, maximum 64 characters.
avatarstring | nullYesAvatar URL, maximum 500 characters.
birthdaystring(date-time) | nullYesDate of birth.
genderinteger | nullYes1 male, 2 female, null unknown.
pet_typeinteger | nullYes1 cat, 2 dog, 3 exotic pet, null unspecified.
pet_varietystring | nullYesBreed text supplied by the caller, maximum 100 characters.
breed_codestring | nullYesStandard breed code, maximum 64 characters; get values from Breed library lookup.
weightstring | nullYesWeight as a string with a unit, such as "10.10kg", maximum 20 characters.
is_neuteredinteger | nullYes0 not neutered, 1 neutered, null unknown.
localestringNoDisplay language actually used for this response.
breed_display_namestring | nullNoStandard breed display name returned according to locale.
created_at / updated_atstring(date-time)NoCreation and update time.
recordsobjectNoReturned by the detail endpoint only: extension records grouped by record_type; {} when there are no records.

Field validation rules ​

FieldRule
nameRequired (on creation), maximum 64 characters.
genderOnly 1, 2, or null is allowed.
pet_typeOnly 1, 2, 3, or null is allowed.
is_neuteredOnly 0, 1, or null is allowed.
breed_codeWhen non-empty it must exist in the platform standard breed library (see Breed library lookup); when pet_type is cat or dog the code prefix must match.
weightString; always include a unit (such as kg).
birthdayISO 8601 date-time string. Use null for an unknown value, not an empty string.

Error handling ​

HTTP statusMeaningCaller action
400A business rule is not satisfied, for example locale is not enabled or the breed does not match the type.Read message and correct the input.
401 / 403Token missing, invalid, or insufficient permission.Exchange a new Token; do not pass internal identity fields.
404The profile does not exist, was deleted, or does not belong to the current user.Refresh local state; do not treat it as safe to retry.
422A field type, length, or format does not match the schema.Correct it per the field rules and retry.
429Rate limit triggered.Back off and retry.
5xxThe service or a dependency is temporarily unavailable.Reads may be retried; for write operations confirm the previous result first to avoid duplicate creation.

Endpoints not covered in this round ​

The pet extension records (the /pet-profiles/{pet_profile_id}/records family) are not used in the current public flow, so they were not turned into endpoint pages in this round. Evaluate them separately when needed.

最近更新

Qijie Open Platform · API Documentation