> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/mutations/food-log/ai-food-log/save-ai-food-log.md).

# Save Ai Food Log

Use the `saveAiFoodLog` mutation to save a food analysis result generated by the **processAiFood** mutation as a food log entry.

{% hint style="info" %}
AI Food Log entries can be retrieved using the [expressMealTracks](/graphql/query/queries/food-log/express-meal-track-entries.md) query.
{% endhint %}

## Arguments

| Argument         | Type               | Description                                                                                  |
| ---------------- | ------------------ | -------------------------------------------------------------------------------------------- |
| `input`          | ProcessAIFoodInput |                                                                                              |
| `input.datetime` | DateTime           | The date when the food will be logged. Use the format: `YYYY-MM-DDT hh:mm:ssZ`               |
| `input.mealtime` | MealTime!          | <p>Meal time to assign.<br>enum MealTime {<br>BREAKFAST<br>LUNCH<br>DINNER<br>SNACK<br>}</p> |
| `input.id`       | ID!                | Id of the processed food.                                                                    |

## Available Fields

|           |         |                                                                            |
| --------- | ------- | -------------------------------------------------------------------------- |
| `success` | Boolean | **True** if the food log has been saved. Otherwise, it displays **False.** |
| `message` | String  | Description of the result.                                                 |

## Example

{% tabs %}
{% tab title="Request" %}

```graphql
mutation{
  saveAiFoodLog(
    input:{
      datetime:"2025-05-23T17:07:21-07:00"
      mealTime:DINNER
      id:"Rm9vZEFuYWx5c2lzOmJlZjdiYTQ3LWM4NmYtNDE1NC04OGI1LTY2NTY4ZGQ2M2UxZQ=="
    }
  ){
    success
    message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "saveAiFoodLog": {
      "success": true,
      "message": "Ai Food Processed"
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/food-log/ai-food-log/save-ai-food-log.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
