Get Access Request

Retrieve request status and monitor asynchronous operations

Overview

Retrieves the current status of an access request. Use this to monitor asynchronous operations until they complete.

get
Authorizations
Path parameters
idstringRequired
Responses
200

OK

application/json
get
/api/private/lifecycle_management/access_requests/{id}
GET /api/private/lifecycle_management/access_requests/{id} HTTP/1.1
Host: your-tenant.cookiecloud.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "value": {},
  "plans": [
    {
      "id": "text",
      "state": 1,
      "request_type": 1,
      "request_source": 1,
      "plan_source": 1,
      "plan_source_id": "text",
      "plan_jobs": [
        {
          "job_id": "text",
          "data_source": {
            "id": "text",
            "external_id": "text",
            "agent_type": "text",
            "data_provider_id": "text",
            "data_source_config": {
              "@type": "text",
              "ANY_ADDITIONAL_PROPERTY": "anything"
            },
            "data_provider_type": 1,
            "data_provider_secret_refs": [
              {
                "id": "text",
                "secret_id": "text",
                "vault_id": "text",
                "vault": {
                  "id": "text",
                  "name": "text",
                  "vault_provider": "text",
                  "insight_point_id": "text",
                  "deleted": true
                }
              }
            ]
          },
          "input_entities": [
            {
              "table": "text",
              "primary_key": [
                "text"
              ],
              "constraints": [
                {
                  "type": 1,
                  "field_names": [
                    "text"
                  ]
                }
              ]
            }
          ],
          "action_type": 1,
          "action_config": {
            "@type": "text",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "action_job_id": "text",
          "action_name": "text",
          "identity_id": "text",
          "stop_on_error": true,
          "ttl": "text"
        }
      ],
      "error_message": "text",
      "request_source_id": "text",
      "jit_duration_in_seconds": 1,
      "jit_revoke_at": "2025-11-07T09:25:10.059Z",
      "jit_revoke_jobs": [
        {
          "job_id": "text",
          "data_source": {
            "id": "text",
            "external_id": "text",
            "agent_type": "text",
            "data_provider_id": "text",
            "data_source_config": {
              "@type": "text",
              "ANY_ADDITIONAL_PROPERTY": "anything"
            },
            "data_provider_type": 1,
            "data_provider_secret_refs": [
              {
                "id": "text",
                "secret_id": "text",
                "vault_id": "text",
                "vault": {
                  "id": "text",
                  "name": "text",
                  "vault_provider": "text",
                  "insight_point_id": "text",
                  "deleted": true
                }
              }
            ]
          },
          "input_entities": [
            {
              "table": "text",
              "primary_key": [
                "text"
              ],
              "constraints": [
                {
                  "type": 1,
                  "field_names": [
                    "text"
                  ]
                }
              ]
            }
          ],
          "action_type": 1,
          "action_config": {
            "@type": "text",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "action_job_id": "text",
          "action_name": "text",
          "identity_id": "text",
          "stop_on_error": true,
          "ttl": "text"
        }
      ],
      "created_at": "2025-11-07T09:25:10.059Z",
      "started_at": "2025-11-07T09:25:10.059Z",
      "completed_at": "2025-11-07T09:25:10.059Z",
      "identity_id": "text",
      "jit_revoke_completed_at": "2025-11-07T09:25:10.059Z"
    }
  ]
}

Examples

Basic Request

curl -X GET "https://your-instance.vezacloud.com/api/private/lifecycle_management/access_requests/{id}" \
  -H "authorization: Bearer YOUR_API_TOKEN"

Response

{
  "value": {
    "id": "0198cfb4-0adb-740b-8e2d-7a7c09044996",
    "reason": "User needs access to project resources",
    "datasource_id": "lcm-datasource-id", 
    "assignee_entity_type": "ActiveDirectoryUser",
    "assignee_entity_id": "active_directory:domain:example.com:user:jsmith",
    "target_entity_type": "ActiveDirectoryGroup",
    "target_entity_ids": ["active_directory:domain:example.com:group:developers"],
    "request_source": "ACCESS_REQUEST",
    "state": "COMPLETED",
    "access_plan_ids": ["plan-abc-123"],
    "request_type": "GRANT",
    "identity_id": "identity-abc-123",
    "assignee_entity_name": "Jane Smith",
    "target_entity_names": ["Developers"],
    "notes": [],
    "error_message": "",
    "created_by": "user-123",
    "created_at": "2025-08-22T02:50:45.123456789Z",
    "completed_at": "2025-08-22T02:50:51.372691185Z"
  },
  "plans": [
    {
      "id": "plan-abc-123",
      "state": "COMPLETED",
      "request_type": "GRANT",
      "completed_at": "2025-08-22T02:50:51.372691185Z"
    }
  ]
}

Polling Script (Bash)

#!/bin/bash
REQUEST_ID="0198cfb4-0adb-740b-8e2d-7a7c09044996"
MAX_ATTEMPTS=60

for ((i=1; i<=MAX_ATTEMPTS; i++)); do
  STATUS=$(curl -s "https://your-instance.vezacloud.com/api/private/lifecycle_management/access_requests/$REQUEST_ID" \
    -H "authorization: Bearer YOUR_API_TOKEN")

  STATE=$(echo $STATUS | jq -r '.value.state')
  echo "Attempt $i: $STATE"

  case "$STATE" in
    "COMPLETED")
      echo "Success!"
      exit 0
      ;;
    "ERRORED"|"CANCELED"|"REJECTED")
      ERROR_MSG=$(echo $STATUS | jq -r '.value.error_message // .value.rejection_reason // "Unknown error"')
      echo "Failed: $ERROR_MSG"
      exit 1
      ;;
  esac

  sleep 5
done

Polling Function (Python)

import requests
import time

def wait_for_completion(request_id, base_url, api_token, timeout=300):
    url = f"{base_url}/api/private/lifecycle_management/access_requests/{request_id}"
    headers = {"authorization": f"Bearer {api_token}"}
    start_time = time.time()

    while True:
        if time.time() - start_time > timeout:
            raise Exception(f"Request timed out after {timeout}s")

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

        data = response.json()["value"]
        state = data["state"]

        print(f"Status: {state}")

        if state == "COMPLETED":
            return data
        elif state in ["ERRORED", "CANCELED", "REJECTED"]:
            error_msg = data.get("error_message") or data.get("rejection_reason") or "Unknown error"
            raise Exception(f"Request {state}: {error_msg}")

        time.sleep(5)

Last updated

Was this helpful?