---
title: "Retrieves a list of sites associated with a codebase."
method: GET
path: "/codebases/{codebaseId}/sites"
tags: ["Sites"]
---

# Retrieves a list of sites associated with a codebase.

`GET /codebases/{codebaseId}/sites`

## Request

- Base URL: `https://api.acquia.com/v3`
- URL: `https://api.acquia.com/v3/codebases/{codebaseId}/sites`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/docs/codebases/:codebaseId/sites/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `codebaseId` string, required

## Query parameters

- `offset` integer
- `limit` integer
- `filter` string
- `sort` string

## Response `200`

OK

- object
  - `_links` object, required: HAL links for the resource
    - `self` SiteServiceAPIHalLink, required: HAL link object
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` boolean: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `prev` SiteServiceAPIHalLink: HAL link object
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` boolean: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `next` SiteServiceAPIHalLink: HAL link object
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` boolean: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `offset` object: Templated link for offset
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` true, required: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `limit` object: Templated link for limit
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` true, required: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `filter` object: Templated link for filtering. The `filter` query parameter is a string to signify the fields to filter the result set by. If the filter includes logical filters this string will be delimited by a "," for a logical OR filter, or a ";" for logical AND filters. Note: Only one type logical filter will be accepted. If the filter contains both OR and AND filters it will be rejected. (e.g. filter=field=value*;field2=value2* indicates that the result set will be filtered by "field" using the term "value*" AND "field2" using the term "value2*". Note that * is a wildcard character in this context). Allowed filter operators are: Equals: = (%3D), Does not equal: != (!%3D), Greater than: > (%3E), Less than: < (%3C), Greater than or equal to: >= (%3E%3D), Less than or equal to: <= (%3C%3D), Contains substring: =@ (%3D@), Does not contain substring: !@ (!@)
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` true, required: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
    - `sort` object: Templated link for sorting. The `sort` query parameter is a comma-delimited string with fields that are used for sorting. The order of fields is significant. A leading "-" in the field name indicates the field should be sorted in descending order. (e.g. sort=field,-field2 indicates that the result set will be sorted by "field" in ascending order, then by "field2" in descending order.)
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` true, required: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
  - `_embedded` object, required: Embedded resources for the collection
    - `items` object[], required: The array of resources in the collection
      - `id` string, required: The unique identifier of the site
      - `name` string, required: The machine name of the site. Must start with a lowercase letter and contain only lowercase letters and numbers.
      - `label` string, required: The human-readable label of the site
      - `description` string: A description of the site
      - `codebase_id` string, required: The unique identifier of the codebase this site belongs to
      - `status` 'ready' | 'marked-for-deletion', required: The current lifecycle status of the site. ready indicates the site is active and operational. marked-for-deletion indicates the site has been scheduled for deletion and can still be recovered.
      - `delete_at` string, date-time: ISO 8601 datetime indicating when the site is scheduled for deletion. Only present when status is marked-for-deletion.
      - `_links` object, required: HAL links for the resource
        - `self` SiteServiceAPIHalLink, required: HAL link object
          - `href` union, required: The target URI of the link (can be a URI or URI template)
            - string, uri
            - string, uri-template
          - `templated` boolean: Whether the link is a URI template
          - `type` string: Hint about the media type expected when dereferencing the target resource
          - `deprecation` string: A URL to a resource that provides deprecation information
          - `name` string: A secondary key for selecting links
          - `profile` string: A URI that hints about the profile of the target resource
          - `title` string: A human-readable identifier for the link
          - `hreflang` string: The language of the target resource
      - `_embedded` object: Embedded resources (optional)
  - `count` integer, required: The number of items in the current page
  - `total` integer, required: The total number of items available
  - `pagination` object, required
    - `total` integer, required: The total number of items available
    - `limit` integer, required: The maximum number of items to retrieve in a single page
    - `offset` integer, required: The starting position of the items to retrieve

## Other responses

- `400`: Validation Error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api.md) - [All operations](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/revisions/508f8f94456d?raw)
