Get RBAC Policy - Stytch Docs

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

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

Get

cURL

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

Python

import requests

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

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

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

print(response.text)

JavaScript (Fetch API)

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

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

PHP

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/rbac_policy",
  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/rbac_policy"

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))
}

Unirest (Java)

HttpResponse<String> response = Unirest.get("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug/rbac_policy")
  .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/rbac_policy")

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

Status Codes

Example Response

{
  "request_id": "<string>",
  "policy": {
    "stytch_resources": [
      {
        "resource_id": "<string>",
        "description": "<string>",
        "available_actions": [
          "<string>"
        ]
      }
    ],
    "custom_roles": [
      {
        "role_id": "<string>",
        "description": "<string>",
        "permissions": [
          {
            "resource_id": "<string>",
            "actions": [
              "<string>"
            ]
          }
        ]
      }
    ],
    "custom_resources": [
      {
        "resource_id": "<string>",
        "description": "<string>",
        "available_actions": [
          "<string>"
        ]
      }
    ],
    "custom_scopes": [
      {
        "scope": "<string>",
        "description": "<string>",
        "permissions": [
          {
            "resource_id": "<string>",
            "actions": [
              "<string>"
            ]
          }
        ]
      }
    ],
    "stytch_member": {
      "permissions": [
        {
          "resource_id": "<string>",
          "actions": [
            "<string>"
          ]
        }
      ]
    },
    "stytch_admin": {
      "permissions": [
        {
          "resource_id": "<string>",
          "actions": [
            "<string>"
          ]
        }
      ]
    },
    "stytch_user": {
      "permissions": [
        {
          "resource_id": "<string>",
          "actions": [
            "<string>"
          ]
        }
      ]
    }
  },
  "status_code": 123
}

Error Responses

401 Unauthorized

{
  "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"
}

429 Too Many Requests

{
  "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"
}

500 Internal Server Error

{
  "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
string (header) required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

Response

Response Type