Skip to main content
POST
/
v2
/
access-requests
Create Access Request
curl --request POST \
  --url https://public.api.serval.com/v2/access-requests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "teamId": "<string>",
  "roleId": "<string>",
  "targetUserId": "<string>",
  "accessMinutes": 123,
  "businessJustification": "<string>",
  "scheduledStartAt": "<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>"
      }
    ]
  }
}

Documentation Index

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

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

Authorizations

Authorization
string
header
required

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

Body

application/json
teamId
string
required

The ID of the team. Required.

roleId
string
required

The ID of the role (entitlement) to request access for. Required.

targetUserId
string | null

The ID of the user to request access for. Defaults to the authenticated user if omitted.

accessMinutes
integer<int32>

The duration of access in minutes. Must not exceed the role's max_access_minutes. Required unless the role has no maximum duration.

businessJustification
string | null

A business justification for the access request. Required if the role's access policy requires justification.

scheduledStartAt
string | null

An optional scheduled start time for provisioning (RFC3339 format). If omitted, access is provisioned immediately upon approval.

Response

Success

data
data · object

The created access request.