# List credential pools for a workspace GET https://api.prolific.com/api/v1/credentials/ Retrieve a list of credential pools belonging to a specific workspace. Each credential pool summary includes the pool ID, total number of credentials, number of available (unredeemed) credentials, and the workspace ID. Reference: https://beta-docs.prolific.com/api-reference/credentials/list-credential-pools ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List credential pools for a workspace version: endpoint_credentials.ListCredentialPools paths: /api/v1/credentials/: get: operationId: list-credential-pools summary: List credential pools for a workspace description: >- Retrieve a list of credential pools belonging to a specific workspace. Each credential pool summary includes the pool ID, total number of credentials, number of available (unredeemed) credentials, and the workspace ID. tags: - - subpackage_credentials parameters: - name: workspace_id in: query description: The workspace ID to filter credential pools by required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string - name: Authorization in: header required: true schema: type: string responses: '200': description: Credential pools retrieved successfully content: application/json: schema: $ref: >- #/components/schemas/Credentials_ListCredentialPools_Response_200 '400': description: Error content: {} '403': description: Forbidden - User does not have workspace.workspace_update permission content: {} '502': description: Bad Gateway - Credentials service unavailable or internal error content: {} components: schemas: ApiV1CredentialsGetResponsesContentApplicationJsonSchemaCredentialPoolsItems: type: object properties: credential_pool_id: type: string description: The unique identifier for the credential pool total_credentials: type: integer description: Total number of credentials in the pool available_credentials: type: integer description: Number of unredeemed credentials available Credentials_ListCredentialPools_Response_200: type: object properties: credential_pools: type: array items: $ref: >- #/components/schemas/ApiV1CredentialsGetResponsesContentApplicationJsonSchemaCredentialPoolsItems ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/credentials/" querystring = {"workspace_id":"507f1f77bcf86cd799439011"} headers = {"Authorization": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011'; const options = {method: 'GET', headers: {Authorization: ''}}; 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" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") 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.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/credentials/?workspace_id=507f1f77bcf86cd799439011")! 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() ```