Delete a gallery image

Overview

Remove an image from the gallery.

Use this to clean up.

You'll need the image id.

The image is removed. It must belong to company_id; otherwise you get 400.

Prerequisites

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

DELETE /api/v1/account/images/delete

Authentication

Partner or Account token

  • company_id must be inside your own account tree. A Partner token can use any account under the partner; an Account token only its own account.
  • An account outside your tree, or one that doesn't exist, is rejected with 422.
  • The image must belong to company_id; otherwise 400.

Rate limit

This endpoint has no rate limit.

Request parameters

None.

Request body

Sent as JSON in the body of the DELETE request.

FieldTypeRequiredDescription
company_idintegerYesThe account. Must exist and be inside your account tree.
image_idintegerYesThe image to delete. Must exist and belong to company_id.

Request payload

{
  "company_id": 5994,
  "image_id": 12
}

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
messagestringImage has been deleted successfully!.

Response payload

{
  "data": {
    "status": "success",
    "message": "Image has been deleted successfully!"
  }
}

Examples

Success payload

See Response payload.

Error payload

400 Image not found

{
  "message": "Bad Request",
  "status": "error",
  "errors": "Image not found!"
}

422 image_id is missing

{
  "message": "The image id field is required.",
  "errors": {
    "image_id": [
      "The image id field is required."
    ]
  }
}

422 image_id doesn't exist

{
  "message": "The selected image id is invalid.",
  "errors": {
    "image_id": [
      "The selected image id is invalid."
    ]
  }
}

422 Account outside your tree

{
  "message": "The selected company id does not belong to your company hierarchy.",
  "errors": {
    "company_id": [
      "The selected company id does not belong to your company hierarchy."
    ]
  }
}
StatusMeaning
200The image was deleted.
400The image doesn't belong to company_id.
401The token is missing, expired or invalid.
422company_id or image_id is missing or doesn't exist, or company_id is outside your tree.
500Unexpected server error.

Example request

curl --request DELETE \
  --url "https://production-api.shoutaboutus.com/api/v1/account/images/delete" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"company_id": 5994, "image_id": 12}'

Did this page help you?