[Solved] [Sandbox] Upload using API succeeds but Image isn't retrievable

Hi, this is my first topic here.
In a sandbox environment I upload images using the API. I’m using an API key from inside the Sandbox.

The upload is successful the image URL works but the image can not be found in Media nor retrieved with GraphQl.

The job result is:

      "id": "2208651",
      "type": "upload",
      "attributes": {
        "size": 737908,
        "width": 1500,
        "height": 1500,
        "path": "/31162/1595338109-798defb3-9db2-49c4-b7eb-ee4b0c3ee7cd-6.jpg",
        "format": "jpg",
        "author": null,
        "notes": null,
        "copyright": null,
        "default_field_metadata": {
          "de": {
            "alt": "",
            "title": "",
            "custom_data": {
              "image_type": "image_06-de_DE",
              "original_image_name": "7/0/3/1/7031b6e0a153675a89f4d7ed7522d1762ad1676e_71t05R_GGtL._SL1500_.jpg"
        "is_image": true,
        "created_at": "2020-07-21T13:28:32.319Z",
        "updated_at": "2020-07-21T13:28:32.331Z",
        "url": "https://www.datocms-assets.com/31162/1595338109-798defb3-9db2-49c4-b7eb-ee4b0c3ee7cd-6.jpg",
        "tags": [],
        "filename": "798defb3-9db2-49c4-b7eb-ee4b0c3ee7cd-6.jpg",
        "basename": "798defb3-9db2-49c4-b7eb-ee4b0c3ee7cd-6",
        "exif_info": [],
        "mime_type": "image/jpeg",
        "colors": [
            "red": 163,
            "green": 144,
            "blue": 33,
            "alpha": 255
            "red": 211,
            "green": 206,
            "blue": 174,
            "alpha": 255
            "red": 151,
            "green": 142,
            "blue": 84,
            "alpha": 255
            "red": 102,
            "green": 89,
            "blue": 13,
            "alpha": 255
            "red": 232,
            "green": 221,
            "blue": 150,
            "alpha": 255
            "red": 86,
            "green": 53,
            "blue": 45,
            "alpha": 255
        "smart_tags": [
        "duration": null,
        "frame_rate": null,
        "mux_playback_id": null,
        "blurhash": "LTMQt%M_x{oz02D%t1oeD*M{fOWC",
        "mux_mp4_highest_res": null

Hi @npapagiannopoulos and welcome!

Uploads are linked to environments. So, when browsing the Media area, be sure that you are viewing the right environment. You can switch environment using this select:

It appears only when you have at least one sandbox environment.

When fetching data via GraphQL, remember to specify the correct environment too.

I see that the upload has been uploaded to the primary environment and not in the sandbox one. So please check that you are setting the right environment when using the rest api too.

Since you are on a paid plan, please contact us using the support form at https://www.datocms.com/support next time to get an higher priority level :slight_smile:

Let us know if you have more questions!

1 Like