## Documentation Index

Fetch the complete documentation index at: [/docs/llms.txt](/content/docs/llms.txt)

Use this file to discover all available pages before exploring further.

### Get All Public Tokens

**cURL**

```bash
curl --request GET \
  --url https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens \
  --header 'Authorization: Basic <encoded-value>'
```

```python
import requests

url = "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens"

headers = {"Authorization": "Basic <encoded-value>"}

response = requests.get(url, headers=headers)

print(response.text)
```

```javascript
const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};

fetch('https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
```

```go
package main

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

func main() {

url := "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens"

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

req.Header.Add("Authorization", "Basic <encoded-value>")

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

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

fmt.Println(string(body))
}
```

```java
HttpResponse<String> response = Unirest.get("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens")
  .header("Authorization", "Basic <encoded-value>")
  .asString();
```

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

url = URI("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/public_tokens")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'

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

### Possible Response Codes

- **200**
- **401**
- **429**
- **500**

### Sample JSON Responses

**Successful Response**
```json
{
  "request_id": "<string>",
  "public_tokens": [
    {
      "public_token": "<string>",
      "created_at": "<string>"
    }
  ],
  "status_code": 123
}
```

**Unauthorized Response**
```json
{
  "status_code": 401,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "unauthorized_credentials",
  "error_message": "Unauthorized credentials.",
  "error_url": "https://stytch.com/docs/api/errors/401"
}
```

**Too Many Requests Response**
```json
{
  "status_code": 429,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "too_many_requests",
  "error_message": "Too many requests have been made.",
  "error_url": "https://stytch.com/docs/api/errors/429"
}
```

**Internal Server Error Response**
```json
{
  "status_code": 500,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "internal_server_error",
  "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
  "error_url": "https://stytch.com/docs/api/errors/500"
}
```

### Authorizations

Authorization is a required header that must be provided in the format:
`Basic <encoded-value>`, where `<encoded-value>` is the base64-encoded string `username:password`.

### Path Parameters
- **project_slug**: required
- **environment_slug**: required

### Response Attributes
- **request_id**: required string
- **public_tokens**: required object array
- **status_code**: required integer<int32>
