> 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 %}
