# List Workspace Invites GET /api/v1/invites/list/ List all invites for a workspace. Uses current workspace context if available, otherwise requires workspace_id parameter. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/invites/list-retrieve ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/invites/list/: get: operationId: list-retrieve summary: List Workspace Invites description: >- List all invites for a workspace. Uses current workspace context if available, otherwise requires workspace_id parameter. tags: - subpackage_invites parameters: - name: status in: query description: Filter by invite status (pending, accepted, cancelled, expired) required: false schema: type: string - name: workspace_id in: query description: >- ID of the workspace to list invites for (optional if workspace context is set) required: false schema: type: integer responses: '200': description: List of invites content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkspaceInviteList' '400': description: Bad Request content: application/json: schema: description: Any type '403': description: Permission denied content: application/json: schema: description: Any type components: schemas: Role553Enum: type: string enum: - '1' - '2' - '3' - '4' description: |- * `1` - Viewer * `2` - Editor * `3` - Admin * `4` - Owner title: Role553Enum Status21eEnum: type: string enum: - pending - accepted - cancelled - expired description: |- * `pending` - Pending * `accepted` - Accepted * `cancelled` - Cancelled * `expired` - Expired title: Status21eEnum WorkspaceInviteList: type: object properties: id: type: integer token: type: string format: uuid description: Unique token for invite identification email: type: string format: email description: Email address of the person being invited role: $ref: '#/components/schemas/Role553Enum' description: |- Role to assign when invite is accepted * `1` - Viewer * `2` - Editor * `3` - Admin * `4` - Owner role_display: type: string description: |- Get human-readable role name. Args: obj: The model instance being serialized (typically WorkspaceInvite) Returns: str: The human-readable role name, or "UNKNOWN" if not found status: $ref: '#/components/schemas/Status21eEnum' description: |- Current status of the invitation * `pending` - Pending * `accepted` - Accepted * `cancelled` - Cancelled * `expired` - Expired message: type: string description: Optional message from the inviter created_at: type: string format: date-time expires_at: type: string format: date-time description: When this invite expires accepted_at: type: - string - 'null' format: date-time description: When the invite was accepted invited_by_email: type: string format: email invited_by_username: type: string workspace_name: type: string required: - id - token - email - role_display - status - created_at - expires_at - accepted_at - invited_by_email - invited_by_username - workspace_name description: Serializer for listing workspace invites. title: WorkspaceInviteList ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/api/v1/invites/list/" payload = {} headers = {"Content-Type": "application/json"} response = requests.get(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/api/v1/invites/list/'; const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/invites/list/" payload := strings.NewReader("{}") req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Content-Type", "application/json") 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.example.com/api/v1/invites/list/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.example.com/api/v1/invites/list/") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('GET', 'https://api.example.com/api/v1/invites/list/', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/api/v1/invites/list/"); var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/invites/list/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```