Animal Management
1 Get animals list
Endpoint: GET /profile/animals
Description: Get user animals list. Requires Bearer Token.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
{}
Response (200 Ok):
{
"message": "Animals retrieved successfully",
"user_id": 1,
"animal_list": [
{
"id": 19,
"animal_type": "service_dog",
"name": "Buddy",
"gender": "male",
"breed": "Labrador",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z",
"birth_year": "2019",
"profile_photo_url": null,
"age": "6 years",
"team": {
"account_id": 1,
"animal_id": 19,
"team_code": "SDS-4558555",
"is_primary_owner": 1,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z"
}
},
{
"id": 18,
"animal_type": "service_dog",
"name": "Pedro",
"gender": "male",
"breed": "HellHound",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T13:59:39.000000Z",
"updated_at": "2025-04-15T13:59:39.000000Z",
"birth_year": "2020",
"profile_photo_url": null,
"age": "5 years",
"team": {
"account_id": 1,
"animal_id": 18,
"team_code": "SDS-3833512",
"is_primary_owner": 0,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:32.000000Z",
"updated_at": "2025-04-15T14:25:32.000000Z"
}
}
],
"animal_list_trained": []
}
2 Add Animal (For Handlers Only)
Endpoint: POST /profile/animals
Description: Adds an animal for handlers. Requires Bearer Token.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
{
"animal_type": "service dog",
"name": "sharik44",
"gender": "Male",
"birth_year": "2020",
"breed": "Labrador",
"size": "Large",
"microchip_number": "123456789ABC",
"in_training": true,
"created_at": "2025-02-27T14:02:01.000000Z",
"updated_at": "2025-02-27T15:03:08.000000Z"
}
Response (201 Created):
{
"message": "Animal added successfully",
"user_id": 1,
"data": {
"animal_type": "service_dog",
"name": "sharik44",
"gender": "male",
"birth_year": "2020",
"breed": "Labrador",
"size": "large",
"microchip_number": "123456789ABC",
"status": "unregistered",
"updated_at": "2025-04-15T14:31:58.000000Z",
"created_at": "2025-04-15T14:31:58.000000Z",
"id": 20,
"age": "5 years",
"profile_photo_url": null
},
"animal_list": [
{
"id": 19,
"animal_type": "service_dog",
"name": "Buddy",
"gender": "male",
"breed": "Labrador",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z",
"birth_year": "2019",
"profile_photo_url": null,
"age": "6 years",
"team": {
"account_id": 1,
"animal_id": 19,
"team_code": "SDS-4558555",
"is_primary_owner": 1,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z"
}
},
{
"id": 18,
"animal_type": "service_dog",
"name": "Pedro",
"gender": "male",
"breed": "HellHound",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T13:59:39.000000Z",
"updated_at": "2025-04-15T13:59:39.000000Z",
"birth_year": "2020",
"profile_photo_url": null,
"age": "5 years",
"team": {
"account_id": 1,
"animal_id": 18,
"team_code": "SDS-3833512",
"is_primary_owner": 0,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:32.000000Z",
"updated_at": "2025-04-15T14:25:32.000000Z"
}
},
{
"id": 20,
"animal_type": "service_dog",
"name": "sharik44",
"gender": "male",
"breed": "Labrador",
"size": "large",
"microchip_number": "123456789ABC",
"status": "unregistered",
"profile_photo_path": null,
"created_at": "2025-04-15T14:31:58.000000Z",
"updated_at": "2025-04-15T14:31:58.000000Z",
"birth_year": "2020",
"profile_photo_url": null,
"age": "5 years",
"team": {
"account_id": 1,
"animal_id": 20,
"team_code": "SDS-8922793",
"is_primary_owner": 1,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:31:59.000000Z",
"updated_at": "2025-04-15T14:31:59.000000Z"
}
}
]
}
Errors (422 Unprocessable Entity - Validation Errors):
{
"errors": {
"animal_type": ["The animal type field is required."]
}
}
**3 Update Animal **
Endpoint: PUT /profile/animals/{animal_id}
Description: Update the handlers animal by id. Requires Bearer Token. If you pass data using multipart/form-data in this method, you can pass the "photo" parameter and attach a picture. In this case, the photo of the animal will be updated.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
{
"animal_type": "service dog",
"name": "sharik44",
"gender": "Male",
"birth_year": "2020",
"breed": "Labrador",
"size": "Large",
"microchip_number": "123456789ABC",
"in_training": true,
"created_at": "2025-02-27T14:02:01.000000Z",
"updated_at": "2025-02-27T15:03:08.000000Z"
}
Response (200 Ok):
{
"message": "Animal updated successfully",
"data": {
"id": 20,
"animal_type": "service_dog",
"name": "sharik4",
"gender": "male",
"breed": "Labrador2",
"size": "large",
"microchip_number": "123456782ABC",
"status": "unregistered",
"profile_photo_path": null,
"created_at": "2025-04-15T14:31:58.000000Z",
"updated_at": "2025-04-15T14:34:48.000000Z",
"birth_year": "2020",
"age": "5 years",
"profile_photo_url": null
},
"user_id": 1,
"animal_list": [
{
"id": 19,
"animal_type": "service_dog",
"name": "Buddy",
"gender": "male",
"breed": "Labrador",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z",
"birth_year": "2019",
"profile_photo_url": null,
"age": "6 years",
"team": {
"account_id": 1,
"animal_id": 19,
"team_code": "SDS-4558555",
"is_primary_owner": 1,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:17.000000Z",
"updated_at": "2025-04-15T14:25:17.000000Z"
}
},
{
"id": 18,
"animal_type": "service_dog",
"name": "Pedro",
"gender": "male",
"breed": "HellHound",
"size": "medium",
"microchip_number": null,
"status": "active",
"profile_photo_path": null,
"created_at": "2025-04-15T13:59:39.000000Z",
"updated_at": "2025-04-15T13:59:39.000000Z",
"birth_year": "2020",
"profile_photo_url": null,
"age": "5 years",
"team": {
"account_id": 1,
"animal_id": 18,
"team_code": "SDS-3833512",
"is_primary_owner": 0,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:25:32.000000Z",
"updated_at": "2025-04-15T14:25:32.000000Z"
}
},
{
"id": 20,
"animal_type": "service_dog",
"name": "sharik4",
"gender": "male",
"breed": "Labrador2",
"size": "large",
"microchip_number": "123456782ABC",
"status": "unregistered",
"profile_photo_path": null,
"created_at": "2025-04-15T14:31:58.000000Z",
"updated_at": "2025-04-15T14:34:48.000000Z",
"birth_year": "2020",
"profile_photo_url": null,
"age": "5 years",
"team": {
"account_id": 1,
"animal_id": 20,
"team_code": "SDS-8922793",
"is_primary_owner": 1,
"trainer_id": null,
"position": 999,
"created_at": "2025-04-15T14:31:59.000000Z",
"updated_at": "2025-04-15T14:31:59.000000Z"
}
}
]
}
**3 Delete user Animal **
Endpoint: DELETE /profile/animals/{animal_id}
Description: Delete the handlers animal by id. Requires Bearer Token.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
{}
Response (200 Ok):
{
"message": "Animal deleted successfully",
"user_id": 13,
"animal_list": [
{
"id": 20,
"account_id": 13,
"animal_type": "service dog",
"name": "Buddy",
"gender": "Male",
"birth_year": "2020",
"breed": "Labrador",
"size": "Large",
"microchip_number": "123456789ABC",
"in_training": true,
"created_at": "2025-02-27T14:03:38.000000Z",
"updated_at": "2025-02-27T14:03:38.000000Z",
"age": "4 years",
"training_status": "In Training"
},
{
"id": 21,
"account_id": 13,
"animal_type": "service dog",
"name": "Buddy",
"gender": "Male",
"birth_year": "2020",
"breed": "Labrador",
"size": "Large",
"microchip_number": "123456789ABC",
"in_training": true,
"created_at": "2025-02-27T14:03:42.000000Z",
"updated_at": "2025-02-27T14:03:42.000000Z",
"age": "4 years",
"training_status": "In Training"
},
{
"id": 22,
"account_id": 13,
"animal_type": "service dog",
"name": "Buddy",
"gender": "Male",
"birth_year": "2020",
"breed": "Labrador",
"size": "Large",
"microchip_number": "123456789ABC",
"in_training": true,
"created_at": "2025-02-27T14:04:11.000000Z",
"updated_at": "2025-02-27T14:04:11.000000Z",
"age": "4 years",
"training_status": "In Training"
}
]
}
**4 Update animal photo **
Endpoint: POST /profile/animals/{animal_id}/photo
Description: Update animal photo by animal id. Requires Bearer Token.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: multipart/form-data
Request Body (JSON):
{
"photo": "photo file attached with multipart/form-data"
}
Response (201 Ok):
{
"message": "Animal photo updated successfully",
"data": {
"animal_id": 52,
"photo_path": "animal-photos/ZNyUTRyIlfKYeanlrpMOAxWY1XhMF3Qvv0YqtNbi.png",
"photo_url": "https://servicedog.local/storage/animal-photos/ZNyUTRyIlfKYeanlrpMOAxWY1XhMF3Qvv0YqtNbi.png"
}
}
**5 Delete animal photo **
Endpoint: DELETE /profile/animals/{animal_id}/photo
Description: Delete animal photo by animal id. Requires Bearer Token.
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
{}
Response (200 Ok):
{
"message": "Animal photo deleted successfully",
"data": {
"animal_id": 52
}
}
**6 Share animal with other user **
Endpoint: POST /profile/animals/animal_id/share
Description: Share the animal with another user
Request Headers:
Authorization: Bearer your_generated_token
X-API-Key: your_api_key
Content-Type: application/json
Request Body (JSON):
Response (200 Ok):
{
"message": "Animal shared successfully",
"data": {
"animal_id": 17,
"shared_with": "
[email protected]"
}
}
15 April 2025