> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rootkey.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask for access to RESTRICTED data

> An agent asks the person it acts for to open ONE RESTRICTED vault or table for a short time. It is the answer to `agent_step_up_required`, which an agent gets only in an organization that allows it (`allowRestrictedStepUp` on `GET /organization`). The answer has a `url`: give it to the person. They open it in ROOTKey and approve with a fresh second factor (or deny). Once approved, the same connection may read and write that vault or table until the approval ends (a few minutes), and never delete anything in it. Follow the request with `GET /agent-step-ups/{stepUpId}`. Asking again while the request waits, or while an approval runs, answers `200` with the same request. Everything else still applies: scopes, the organization's mode, the user's role and teams. The vault is named in the body only. Only a personal access token or an app connected through the hosted connector can call it; it needs the `rootkey.read` scope and a role that may read vaults (for a table, also tables).



## OpenAPI

````yaml post /agent-step-ups
openapi: 3.0.3
info:
  title: ROOTKey Documentation
  description: >-
    Your API of choice for creating, managing, and validating information easily
    and securely!
  termsOfService: https://www.rootkey.ai/legal/privacy-policy
  contact:
    name: ROOTKey
    url: https://www.rootkey.ai/contact
    email: support@rootkey.ai
  version: 1.0.0
servers:
  - description: Production
    url: https://api.rootkey.ai/api-v1/
security:
  - x-api-key: []
  - personalAccessToken: []
tags:
  - name: api-v1-public
    description: Unauthenticated top-level /api-v1 endpoints (health, plans, annual report)
  - name: api-v1-files
    description: >-
      File anchoring, versioning, validation and compliance reporting
      (/api-v1/platform/files)
  - name: api-v1-records
    description: Structured-data record anchoring (/api-v1/platform/records)
  - name: api-v1-vaults
    description: >-
      Vault lifecycle: create / update / delete / restore
      (/api-v1/platform/vaults, /api-v1/vaults)
  - name: api-v1-recovery-points
    description: >-
      Backup archives created from vault contents
      (/api-v1/platform/recovery-point)
  - name: api-v1-organizations
    description: >-
      The identity of a personal access token and the organizations it can act
      in (/api-v1/me, /api-v1/organizations, /api-v1/organization)
  - name: api-v1-agents
    description: >-
      What an agent asks the person it acts for: access to RESTRICTED data for a
      short time (/api-v1/agent-step-ups)
paths:
  /agent-step-ups:
    post:
      tags:
        - api-v1-agents
      summary: Ask for access to RESTRICTED data
      description: >-
        An agent asks the person it acts for to open ONE RESTRICTED vault or
        table for a short time. It is the answer to `agent_step_up_required`,
        which an agent gets only in an organization that allows it
        (`allowRestrictedStepUp` on `GET /organization`). The answer has a
        `url`: give it to the person. They open it in ROOTKey and approve with a
        fresh second factor (or deny). Once approved, the same connection may
        read and write that vault or table until the approval ends (a few
        minutes), and never delete anything in it. Follow the request with `GET
        /agent-step-ups/{stepUpId}`. Asking again while the request waits, or
        while an approval runs, answers `200` with the same request. Everything
        else still applies: scopes, the organization's mode, the user's role and
        teams. The vault is named in the body only. Only a personal access token
        or an app connected through the hosted connector can call it; it needs
        the `rootkey.read` scope and a role that may read vaults (for a table,
        also tables).
      parameters:
        - $ref: '#/components/parameters/OrganizationHeader'
        - $ref: '#/components/parameters/TestModeHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentStepUpRequest'
      responses:
        '200':
          description: >-
            This connection already has a live request for that vault or table:
            the same one, nothing new.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStepUp'
        '201':
          description: The request was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStepUp'
        '400':
          description: >-
            The vault or table is not RESTRICTED, so it needs no approval
            (`agent_step_up_not_required`), the body has no usable
            `vaultAddress` (`invalid_agent_step_up_request`), or the address was
            named differently in the query and the body
            (`conflicting_request_identifiers`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '401':
          description: >-
            Unauthenticated. A missing, malformed, unknown, inactive, revoked or
            expired credential all get the same answer.
        '403':
          description: >-
            The organization does not allow approvals for RESTRICTED data
            (`agent_restricted_data_denied`), too many requests of this
            connection are waiting (`agent_step_up_limit_reached`), or one of
            the agent refusals on the [Errors](/api-reference/errors) page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '404':
          description: >-
            No such vault or table in the organization (`resource_not_found`).
            An API key gets a `404` too: this endpoint is for agents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '429':
          description: >-
            Too many requests for this user. The `Retry-After` header says how
            many seconds to wait. See [Rate Limits](/pages/rate-limits).
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - personalAccessToken: []
components:
  parameters:
    OrganizationHeader:
      name: X-RootKey-Organization
      in: header
      required: false
      schema:
        type: string
      description: >-
        The organization a personal access token acts in: the `id` of one of the
        organizations that `GET /organizations` lists. Required with a personal
        access token on every endpoint that works inside an organization;
        without it the request gets `organization_header_required`. Ignored with
        an API key, which belongs to exactly one organization.
    TestModeHeader:
      name: x-test-mode
      in: header
      required: false
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'false'
      description: >-
        Whether a personal access token works on live data (`false`, the
        default) or on test data (`true`). Only this header decides, never a
        query string or a body field. An API key is itself a test or a live key
        and works on that data.
  schemas:
    AgentStepUpRequest:
      type: object
      required:
        - vaultAddress
      properties:
        vaultAddress:
          type: string
          description: The RESTRICTED vault or table, from `GET /vaults` or `GET /tables`.
    AgentStepUp:
      type: object
      required:
        - id
        - url
        - expiresAt
      properties:
        id:
          type: string
          description: The request. `GET /agent-step-ups/{stepUpId}` reports its state.
        url:
          type: string
          format: uri
          description: >-
            The page in ROOTKey where the person approves or denies it. Give it
            to the person; it names nothing else.
        expiresAt:
          type: string
          format: date-time
          description: >-
            Until when the person can approve it; for an approval that is
            running, when it ends.
    DomainErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            requestId:
              type: string
            message:
              type: string
            errorCode:
              type: string
            docUrl:
              type: string
            timestamp:
              type: string
              format: date-time
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainErrorResponse'
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        ROOTKey API key. A test key works on your organization's test data and a
        live key on its live data; both are used with the same API.
    personalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: rk_pat_...
      description: >-
        Personal access token of a ROOTKey user, sent as `Authorization: Bearer
        rk_pat_...`. A token acts as the user who created it, in the
        organization named by the `X-RootKey-Organization` header, and never
        with more access than that user has in the ROOTKey app: the
        organization's agent policy, the user's own role and teams, and the
        token's scopes (`rootkey.read`, `rootkey.write`, `rootkey.delete`) all
        apply. A missing, malformed, unknown, revoked or expired token gets the
        same `401`. Send either an `x-api-key` or a bearer token, never both: a
        request with both gets `conflicting_credentials`. See
        [Authentication](/api-reference/auth).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.