Skip to main content
POST
/
v2
/
access-requests
/
search
Search Access Requests
curl --request POST \
  --url https://public.api.serval.com/v2/access-requests/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "teamId": "<string>",
  "requestedRoleId": "<string>",
  "appInstanceId": "<string>",
  "statuses": [
    "ACCESS_REQUEST_STATUS_UNSPECIFIED"
  ],
  "targetUserId": "<string>",
  "requestedByUserId": "<string>",
  "createdAfter": "<string>",
  "createdBefore": "<string>",
  "linkedTicketId": "<string>",
  "pageSize": 123,
  "pageToken": "<string>"
}
'
{
  "data": [
    {
      "id": "<string>",
      "teamId": "<string>",
      "status": "ACCESS_REQUEST_STATUS_UNSPECIFIED",
      "createdAt": "<string>",
      "targetUserId": "<string>",
      "requestedRoleId": "<string>",
      "expiresAt": "<string>",
      "linkedTicketId": "<string>",
      "timeAllocations": [
        {
          "id": "<string>",
          "status": "ACCESS_REQUEST_TIME_ALLOCATION_STATUS_UNSPECIFIED",
          "createdAt": "<string>",
          "requestedMinutes": 123,
          "approvedMinutes": 123,
          "businessJustification": "<string>",
          "requestedByUserId": "<string>",
          "invalidationReason": "ACCESS_REQUEST_TIME_ALLOCATION_INVALIDATION_REASON_UNSPECIFIED",
          "linkedTicketId": "<string>",
          "approvalRequestId": "<string>"
        }
      ]
    }
  ],
  "nextPageToken": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
teamId
string

The ID of the team. Required.

requestedRoleId
string | null

Filter by requested role ID.

appInstanceId
string | null

Filter by app instance ID.

statuses
enum<string>[]

Filter by statuses (multiple allowed).

AccessRequestStatus represents the overall status of an access request. Used by the public API for SDK consumers.

Available options:
ACCESS_REQUEST_STATUS_UNSPECIFIED,
ACCESS_REQUEST_STATUS_PENDING,
ACCESS_REQUEST_STATUS_APPROVED,
ACCESS_REQUEST_STATUS_DENIED,
ACCESS_REQUEST_STATUS_EXPIRED,
ACCESS_REQUEST_STATUS_REVOKED,
ACCESS_REQUEST_STATUS_CANCELED,
ACCESS_REQUEST_STATUS_FAILED
targetUserId
string | null

Filter by the target user for whom access was requested.

requestedByUserId
string | null

Filter by the user who requested access.

createdAfter
string | null

Filter by requests created after this timestamp (RFC3339 format).

createdBefore
string | null

Filter by requests created before this timestamp (RFC3339 format).

linkedTicketId
string | null

Filter by linked ticket ID.

pageSize
integer<int32> | null

Maximum number of results to return. Default is 1000, maximum is 5000.

pageToken
string | null

Token for pagination. Leave empty for the first request.

Response

Success

data
AccessRequest · object[]

The list of access requests.

nextPageToken
string | null

Token for retrieving the next page of results. Empty if no more results.