Photos - Update API

Update the specified Photo.

Method PUT

Parameters

Name Details Type Required
id The ID of the Photo. integer Yes

Body

{
    "title": "string",
    "url": "string",
    "thumbnail_url": "string",
    "album_id": "integer"
}

How to Use

fetch('https://simplecrudapi.com/api/photos/1', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Updated Sunset Photo',
    description: 'A beautiful updated sunset view.',
    url: 'https://via.placeholder.com/640x480.png/006644?text=sunset'
  })
})
	.then(response => response.json())
	.then(json => console.log(json))
	.catch(error => console.error(error));

Response

{
    "data": {
        "id": 1,
        "title": "Updated Sunset Photo",
        "description": "A beautiful updated sunset view",
        "url": "https:\/\/via.placeholder.com\/640x480.png\/000088?text=Sunset",
        "uploaded_at": "2024-11-09 20:09:42"
    }
}

Try Now

fetch('https://simplecrudapi.com/api/photos/1', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Updated Sunset Photo',
    description: 'A beautiful updated sunset view.',
    url: 'https://via.placeholder.com/640x480.png/006644?text=sunset'
  })
})
	.then(response => response.json())
	.then(json => console.log(json))
	.catch(error => console.error(error));

Test with Open API

View Open API

Previous
Albums API

Our Proudly Sponsors 🎉

© 2025 Simple CRUD API. All rights reserved.