Each image is a standard Drupal image - i.e. a file, such as an image associated with an article.
I'd like to store and retrieve an image's text as a JSON string somehow "associated" with the image in Drupal's database. My initial plan was to use REST calls (JSON:API, Drupal 8's core REST, or maybe GraphQL) to transmit the text between script and Drupal. However, it appears that these REST implementations will only allow storage of Drupal entities. My JSON strings, not being entities, thus could not be stored using REST.
Is this even possible? How can a script store a JSON string into the Drupal database and link it to a given image?
Please note: I have looked at the existing answers for this issue in drupal.stackexchange and it appears none of them apply to my case. If you believe that an existing answer applies to my case, please point out which answer.