> For the complete documentation index, see [llms.txt](https://docs.hos.accessacloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hos.accessacloud.com/evo-recipes-api/sites.md).

# Sites

Site hierarchy for the organisation

## List sites

> Returns sites for the authenticated organisation, ordered by name ascending and defaulting to active, non-deleted sites.

```json
{"openapi":"3.0.1","info":{"title":"EvoDishesRecipes APIM Operations API","version":"0.1"},"tags":[{"name":"Sites","description":"Site hierarchy for the organisation"}],"servers":[{"url":"https://api.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Production"},{"url":"https://api-dev.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Development"},{"url":"https://api-staging.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Staging"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 client credentials JWT obtained from the Access Identity M2M token endpoint (`POST https://api.hos.accessacloud.com/platform/m2m-auth/v1/token`). The token request must use `grant_type=client_credentials` with `audience=fandb-platform-api evo-dishes-recipes` and `scope=fandb.read fandb.write openid <organisationId>`, where `<organisationId>` is the calling organisation's GUID. The response returns `{ \"access_token\": \"<JWT>\", \"expires_in\": 3599, \"scope\": \"fandb.read fandb.write openid <organisationId>\", \"token_type\": \"bearer\" }`. Tokens expire after `expires_in` seconds (typically ~1 hour). APIM validates the token at the gateway. The token's `scp` claim must also carry the caller's organisation ID as a bare GUID; the backend resolves the tenant by matching that GUID case-insensitively against either the `id` or the `workspace_org_id` column. A token with no organisation GUID is rejected with `401`, and one carrying more than one distinct organisation GUID with `403`."}},"parameters":{"PageSize":{"name":"page_size","in":"query","required":false,"description":"Number of items per page. Clamped to the range [1, 500]. Defaults to 100.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},"Cursor":{"name":"cursor","in":"query","required":false,"description":"Opaque cursor for keyset pagination. Pass the next_cursor value from a previous response to fetch the next page.","schema":{"type":"string"}},"ActiveFilter":{"name":"active","in":"query","required":false,"description":"Filter on the active flag. Use `all` to disable the filter. Defaults to `true`.","schema":{"type":"string","enum":["true","false","all"],"default":"true"}},"DeletedFilter":{"name":"deleted","in":"query","required":false,"description":"Filter on the soft-delete flag. Use `all` to disable the filter. Defaults to `false`.","schema":{"type":"string","enum":["true","false","all"],"default":"false"}},"UpdatedSince":{"name":"updatedSince","in":"query","required":false,"description":"ISO 8601 timestamp. Returns only records updated at or after this instant, ordered by `updatedAt` ascending for incremental sync.","schema":{"type":"string","format":"date-time"}}},"schemas":{"PaginatedResponse":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"Pagination":{"type":"object","required":["page_size","has_next_page","next_cursor"],"properties":{"page_size":{"type":"integer","description":"The page size used for this request."},"has_next_page":{"type":"boolean","description":"Whether more results exist beyond this page."},"next_cursor":{"type":"string","nullable":true,"description":"Cursor to pass as the cursor query parameter for the next page. Null when there are no more results."}}},"Site":{"type":"object","required":["id","name","type","path","depth","sortOrder","active","deleted","updatedAt"],"properties":{"id":{"type":"string","description":"Unique site identifier (UUID)."},"name":{"type":"string"},"code":{"type":"string","nullable":true},"type":{"type":"string","enum":["MANAGEMENT","STANDARD"]},"parentSiteId":{"type":"string","nullable":true},"path":{"type":"string","description":"Materialised path of the site within the hierarchy."},"depth":{"type":"integer"},"sortOrder":{"type":"integer"},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"currencyCode":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message."},"code":{"type":"string","description":"Stable machine-readable error code (e.g. INVALID_QUERY_PARAMETER, MISSING_PATH_PARAMETER, RESOURCE_NOT_FOUND, INTERNAL_ERROR)."},"parameter":{"type":"string","description":"The offending query or path parameter, when applicable."}}}},"responses":{"BadRequest":{"description":"A query or path parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, invalid, or expired authorization token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The token does not grant access to exactly one organisation, so no tenant can be resolved from it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"OrganizationNotFound":{"description":"No tenant found matching the organisation GUID in the token's `scp` claim.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/apim/sites":{"get":{"operationId":"GetSites","summary":"List sites","description":"Returns sites for the authenticated organisation, ordered by name ascending and defaulting to active, non-deleted sites.","tags":["Sites"],"parameters":[{"$ref":"#/components/parameters/PageSize"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/ActiveFilter"},{"$ref":"#/components/parameters/DeletedFilter"},{"$ref":"#/components/parameters/UpdatedSince"}],"responses":{"200":{"description":"Paginated list of sites.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/OrganizationNotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## Get a site

> Returns one site with its parent summary and its direct, non-deleted child sites (at most 500). Deeper descendants are not expanded — the stored \`path\`/\`depth\` columns describe the site's position in the hierarchy, so the rest of the tree can be paged from \`GET /apim/sites\`.

```json
{"openapi":"3.0.1","info":{"title":"EvoDishesRecipes APIM Operations API","version":"0.1"},"tags":[{"name":"Sites","description":"Site hierarchy for the organisation"}],"servers":[{"url":"https://api.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Production"},{"url":"https://api-dev.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Development"},{"url":"https://api-staging.hos.accessacloud.com/evo/dishes-recipes/v1","description":"Staging"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 client credentials JWT obtained from the Access Identity M2M token endpoint (`POST https://api.hos.accessacloud.com/platform/m2m-auth/v1/token`). The token request must use `grant_type=client_credentials` with `audience=fandb-platform-api evo-dishes-recipes` and `scope=fandb.read fandb.write openid <organisationId>`, where `<organisationId>` is the calling organisation's GUID. The response returns `{ \"access_token\": \"<JWT>\", \"expires_in\": 3599, \"scope\": \"fandb.read fandb.write openid <organisationId>\", \"token_type\": \"bearer\" }`. Tokens expire after `expires_in` seconds (typically ~1 hour). APIM validates the token at the gateway. The token's `scp` claim must also carry the caller's organisation ID as a bare GUID; the backend resolves the tenant by matching that GUID case-insensitively against either the `id` or the `workspace_org_id` column. A token with no organisation GUID is rejected with `401`, and one carrying more than one distinct organisation GUID with `403`."}},"parameters":{"SiteId":{"name":"siteId","in":"path","required":true,"description":"The site id (UUID), which must belong to the authenticated organisation.","schema":{"type":"string"}}},"schemas":{"SiteDetail":{"type":"object","description":"Site detail with its parent summary and direct children. Deeper descendants are not expanded — use `path`/`depth` with `GET /apim/sites`.","required":["id","name","type","path","depth","sortOrder","active","deleted","childSites","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Unique site identifier (UUID)."},"name":{"type":"string"},"code":{"type":"string","nullable":true},"type":{"type":"string","enum":["MANAGEMENT","STANDARD"]},"parentSiteId":{"type":"string","nullable":true},"path":{"type":"string","description":"Materialised path of the site within the hierarchy."},"depth":{"type":"integer"},"sortOrder":{"type":"integer"},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"externalId":{"type":"string","nullable":true},"currencyCode":{"type":"string","nullable":true},"preferredCurrencyLocale":{"type":"string","nullable":true},"defaultLanguage":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"sourceTenantIdentifier":{"type":"string","nullable":true},"parentSite":{"nullable":true,"description":"The parent site, or null when there is none or the parent belongs to another organisation.","allOf":[{"$ref":"#/components/schemas/SiteRef"}]},"childSites":{"type":"array","description":"Direct, non-deleted children of this organisation, capped at 500.","items":{"$ref":"#/components/schemas/SiteRef"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"SiteRef":{"type":"object","description":"Lightweight reference to a site in the hierarchy.","required":["id","name","type","active","deleted","depth","sortOrder","path","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"type":{"type":"string","enum":["MANAGEMENT","STANDARD"]},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"depth":{"type":"integer"},"sortOrder":{"type":"integer"},"path":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message."},"code":{"type":"string","description":"Stable machine-readable error code (e.g. INVALID_QUERY_PARAMETER, MISSING_PATH_PARAMETER, RESOURCE_NOT_FOUND, INTERNAL_ERROR)."},"parameter":{"type":"string","description":"The offending query or path parameter, when applicable."}}}},"responses":{"BadRequest":{"description":"A query or path parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, invalid, or expired authorization token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The token does not grant access to exactly one organisation, so no tenant can be resolved from it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No resource found for the given id in the caller's organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/apim/sites/{siteId}":{"get":{"operationId":"GetSite","summary":"Get a site","description":"Returns one site with its parent summary and its direct, non-deleted child sites (at most 500). Deeper descendants are not expanded — the stored `path`/`depth` columns describe the site's position in the hierarchy, so the rest of the tree can be paged from `GET /apim/sites`.","tags":["Sites"],"parameters":[{"$ref":"#/components/parameters/SiteId"}],"responses":{"200":{"description":"The site, its parent and its direct children.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# 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.hos.accessacloud.com/evo-recipes-api/sites.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.
