Sites

Sites are the locations and programs your organisation operates. Use the sites endpoint to list the active sites your access token can read. Listing sites requires the read:sites scope.

The site model

The site model contains the core reference details of a site in your organisation. Like every Diversity Sync resource, a site carries an object discriminator and a livemode flag. Nullable scalars are always present and set to null when unset.

Properties

  • Name
    object
    Type
    string
    Description

    The string site. Identifies the type of this object.

  • Name
    id
    Type
    integer
    Description

    Unique identifier for the site within your organisation.

  • Name
    name
    Type
    string
    Description

    The site's name.

  • Name
    address
    Type
    string
    Description

    The site's address. null when no address is set.

  • Name
    type
    Type
    string
    Description

    The site's program or type. null when no type is set.

  • Name
    status
    Type
    string
    Description

    Either active or archived.

  • Name
    livemode
    Type
    boolean
    Description

    true when the object was created with a live (ds_live_…) key, false for test mode.


GET/v1/sites

List sites

Returns a paginated list of the active sites in your organisation, ordered by name. The response is the standard list envelope: an object with object: "list", the request url, a has_more boolean, and the data array of site objects. Requires the read:sites scope.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    The number of objects to return, between 1 and 100. Defaults to 25.

  • Name
    starting_after
    Type
    integer
    Description

    A cursor for pagination. Pass the id of the last site from the previous page to fetch the next page of results.

Request

GET
/v1/sites
curl -G https://api.diversitysync.com/v1/sites \
  -H "Authorization: Bearer {access_token}" \
  -d limit=25

Response

{
  "object": "list",
  "url": "/v1/sites",
  "has_more": true,
  "data": [
    {
      "object": "site",
      "id": 37,
      "name": "Riverside House",
      "address": "12 Riverside Drive, Brisbane QLD 4000",
      "type": "Supported Independent Living",
      "status": "active",
      "livemode": true
    }
  ]
}

Was this page helpful?