# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
