# API : home

1 opérations REST du groupe home.

Base : `/api/v1`. [Conventions](/documentation/api-conventions/) · [Toutes les ressources](/documentation/api-reference/)

- GET /home : Accueil terrain : récents + prochaines activités (contexte utilisateur uniquement)
## GET /home

```json
{
  "summary": "Accueil terrain : récents + prochaines activités (contexte utilisateur uniquement)",
  "description": "Agrégat personnel en un appel : 5 derniers consultés par catégorie (visibilité appliquée), 10 prochaines activités planifiées de l'utilisateur (retards compris), compteur de notifications non lues. Réservé aux sessions utilisateur (§2bis).",
  "tags": [
    "mobile"
  ],
  "security": [
    {
      "oauth2": []
    },
    {
      "userSession": []
    }
  ],
  "responses": {
    "200": {
      "description": "Agrégat de l'accueil",
      "content": {
        "application/json": {
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "recents": {
                "type": "object",
                "properties": {
                  "companies": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "sub": {
                          "type": "string"
                        },
                        "viewedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "sub",
                        "viewedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "contacts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "sub": {
                          "type": "string"
                        },
                        "viewedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "sub",
                        "viewedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "quotes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "sub": {
                          "type": "string"
                        },
                        "viewedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "sub",
                        "viewedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "companies",
                  "contacts",
                  "quotes"
                ],
                "additionalProperties": false
              },
              "upcomingActivities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "call",
                        "meeting",
                        "task"
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "dueAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startsAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endsAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "companyId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contactId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quoteId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "title",
                    "dueAt",
                    "startsAt",
                    "endsAt",
                    "location",
                    "companyId",
                    "contactId",
                    "quoteId"
                  ],
                  "additionalProperties": false
                }
              },
              "unreadNotifications": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "recents",
              "upcomingActivities",
              "unreadNotifications"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "default": {
      "description": "Erreur - enveloppe problem+json (RFC 9457)",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      }
    }
  }
}
```
