# List Users

GET https://api.webflow.com/v2/sites/{site_id}/users

Get a list of users for a site

Required scope | `users:read`


Reference: https://developers.webflow.com/data/reference/users/users/list

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: List Users
  version: endpoint_users.list
paths:
  /sites/{site_id}/users:
    get:
      operationId: list
      summary: List Users
      description: |
        Get a list of users for a site

        Required scope | `users:read`
      tags:
        - - subpackage_users
      parameters:
        - name: site_id
          in: path
          description: Unique identifier for a Site
          required: true
          schema:
            type: string
            format: objectid
        - name: offset
          in: query
          description: >-
            Offset used for pagination if the results have more than limit
            records
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: 'Maximum number of records to be returned (max limit: 100)'
          required: false
          schema:
            type: integer
        - name: sort
          in: query
          description: |
            Sort string to use when ordering users

            Example(`CreatedOn`, `Email`, `Status`, `LastLogin`, `UpdatedOn`).

            Can be prefixed with a `-` to reverse the sort (ex. `-CreatedOn`)
          required: false
          schema:
            $ref: '#/components/schemas/SitesSiteIdUsersGetParametersSort'
        - name: Authorization
          in: header
          description: >-
            Bearer authentication of the form `Bearer <token>`, where token is
            your auth token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Request was successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users_list_Response_200'
        '400':
          description: Validation failure
          content: {}
        '401':
          description: >-
            Provided access token is invalid or does not have access to
            requested resource
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Requested resource not found
          content: {}
        '429':
          description: >-
            The rate limit of the provided access_token has been reached. Please
            have your application respect the X-RateLimit-Remaining header we
            include on API responses.
          content: {}
        '500':
          description: We had a problem with our server. Try again later.
          content: {}
components:
  schemas:
    SitesSiteIdUsersGetParametersSort:
      type: string
      enum:
        - description: Sorts users in ascending order based on their created date
          value: CreatedOn
        - description: Sorts users in descending order based on their created date
          value: '-CreatedOn'
        - description: Sorts users in ascending order based on their email
          value: Email
        - description: Sorts users in descending order based on their email
          value: '-Email'
        - description: Sorts users in ascending order based on their status
          value: Status
        - description: Sorts users in descending order based on their status
          value: '-Status'
        - description: Sorts users in ascending order based on their last login date
          value: LastLogin
        - description: Sorts users in descending order based on their last login date
          value: '-LastLogin'
        - description: Sorts users in ascending order based on their update date
          value: UpdatedOn
        - description: Sorts users in descending order based on their update date
          value: '-UpdatedOn'
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsStatus:
      type: string
      enum:
        - value: invited
        - value: verified
        - value: unverified
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsAccessGroupsItemsType:
      type: string
      enum:
        - value: admin
        - value: ecommerce
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsAccessGroupsItems:
      type: object
      properties:
        slug:
          type: string
          description: Access group identifier for APIs
        type:
          $ref: >-
            #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsAccessGroupsItemsType
          description: |
            The type of access group based on how it was assigned to the user.
            * `admin` - Assigned to the user via API or in the designer
            * `ecommerce` - Assigned to the user via an ecommerce purchase
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsDataData:
      type: object
      properties:
        name:
          type: string
          description: |
            The name of the user
        email:
          type: string
          description: |
            The email address of the user
        accept-privacy:
          type: boolean
          description: |
            Boolean indicating if the user has accepted the privacy policy
        accept-communications:
          type: boolean
          description: >
            Boolean indicating if the user has accepted to receive
            communications
        additionalProperties:
          type: string
          description: Custom user attributes
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsData:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsDataData
    SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItems:
      type: object
      properties:
        id:
          type: string
          format: objectid
          description: Unique identifier for the User
        isEmailVerified:
          type: boolean
          description: Shows whether the user has verified their email address
        lastUpdated:
          type: string
          format: date-time
          description: The timestamp the user was updated
        invitedOn:
          type: string
          format: date-time
          description: The timestamp the user was invited
        createdOn:
          type: string
          format: date-time
          description: The timestamp the user was created
        lastLogin:
          type: string
          format: date-time
          description: The timestamp the user was logged in
        status:
          $ref: >-
            #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsStatus
          description: The status of the user
        accessGroups:
          type: array
          items:
            $ref: >-
              #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsAccessGroupsItems
          description: Access groups the user belongs to
        data:
          $ref: >-
            #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItemsData
          description: An object containing the User's basic info and custom fields
    users_list_Response_200:
      type: object
      properties:
        count:
          type: number
          format: double
          description: Number of users returned
        limit:
          type: number
          format: double
          default: 10
          description: The limit specified in the request
        offset:
          type: number
          format: double
          default: 0
          description: The offset specified for pagination
        total:
          type: number
          format: double
          description: Total number of users in the collection
        users:
          type: array
          items:
            $ref: >-
              #/components/schemas/SitesSiteIdUsersGetResponsesContentApplicationJsonSchemaUsersItems
          description: List of Users for a Site

```

## SDK Code Examples

```python
from webflow import Webflow

client = Webflow(
    access_token="YOUR_ACCESS_TOKEN",
)
client.users.list(
    site_id="580e63e98c9a982ac9b8b741",
    offset=1,
    limit=1,
    sort="CreatedOn",
)

```

```typescript
import { WebflowClient } from "webflow-api";

const client = new WebflowClient({ accessToken: "YOUR_ACCESS_TOKEN" });
await client.users.list("580e63e98c9a982ac9b8b741", {
    offset: 1,
    limit: 1,
    sort: "CreatedOn"
});

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.get("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
var client = new RestClient("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/users?offset=0&limit=100&sort=CreatedOn")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```