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

# Create a download request

> Create an asynchronous export for a single resource type. The resource type is chosen by the
`context` field — see the `context` field below (`DownloadContext`) for the full list of
values and what each one exports. Returns a request `id`; poll `GET /v1/downloads/{id}` until the
status is `completed` to retrieve the presigned download URL.




## OpenAPI

````yaml /developer-docs/api-reference/downloads-openapi-schema-1.0.0.yaml post /v1/downloads
openapi: 3.0.3
info:
  title: Oleria Downloads API
  description: API for exporting data from Oleria in csv format
  version: 1.0.0
servers:
  - url: https://devx.{tenant}.oleria.io
    description: Oleria DevX Server
    variables:
      tenant:
        default: example
        description: the name of your Oleria workspace
security:
  - clientCredentials: []
tags:
  - name: Downloads
    description: >
      Bulk asynchronous export of Oleria data as CSV — access inventory
      snapshots, identities,

      risks, access requests, lifecycle events, and more. Create a download
      request for the

      dataset you want (set by the `context` field), then poll the request by id
      until it

      completes and returns a presigned download URL.
paths:
  /v1/downloads:
    post:
      tags:
        - Downloads
      summary: Create a download request
      description: >
        Create an asynchronous export for a single resource type. The resource
        type is chosen by the

        `context` field — see the `context` field below (`DownloadContext`) for
        the full list of

        values and what each one exports. Returns a request `id`; poll `GET
        /v1/downloads/{id}` until the

        status is `completed` to retrieve the presigned download URL.
      operationId: CreateDownloadRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadRequestInput'
            examples:
              identities:
                summary: Export all access-inventory identities
                value:
                  context: accessInventoryIdentitiesV2
              identitiesMfaDisabled:
                summary: Export access-inventory identities with MFA disabled
                value:
                  context: accessInventoryIdentitiesV2
                  params:
                    filterBy:
                      - dataType: boolean
                        field: mfaEnabled
                        filterType: eq
                        values:
                          - 'false'
              nonHumanIdentities:
                summary: Export non-human identities (service accounts, keys, bots)
                value:
                  context: accessInventoryNhiV2
              risks:
                summary: Export risks
                value:
                  context: risksV2
              accessRequests:
                summary: Export access requests
                value:
                  context: accessRequests
              lifecycleEvents:
                summary: Export joiner / leaver / mover lifecycle events
                value:
                  context: ilmEmployeeEvents
      responses:
        '201':
          description: Download request created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadRequest'
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - clientCredentials:
            - ClientCredentialsResourceServer/client_credentials_base_scope
components:
  schemas:
    DownloadRequestInput:
      type: object
      description: Input object to create a download request
      required:
        - context
      properties:
        context:
          $ref: '#/components/schemas/DownloadContext'
        fileFormat:
          $ref: '#/components/schemas/FileFormat'
        params:
          type: object
          properties:
            filterBy:
              type: array
              items:
                $ref: '#/components/schemas/Filter'
            sortBy:
              type: array
              items:
                $ref: '#/components/schemas/SortBy'
        downloadUrlTtlMinutes:
          type: integer
          minimum: 1
          maximum: 4320
          default: 5
          description: >-
            Duration that the presigned download URL is valid in minutes.
            Defaults to 5 minutes if no value is given. Cannot be greater than
            4320 minutes (3 days).
    DownloadRequest:
      type: object
      description: Tracks the status of a download request
      required:
        - id
        - context
        - fileFormat
        - status
        - urlTtlMinutes
      properties:
        id:
          type: string
          format: uuid
        context:
          $ref: '#/components/schemas/DownloadContext'
        fileFormat:
          $ref: '#/components/schemas/FileFormat'
        status:
          $ref: '#/components/schemas/DownloadRequestStatus'
        error:
          $ref: '#/components/schemas/Error'
        url:
          type: string
          description: A presigned URL to the S3 object containing the result data.
        urlTtlMinutes:
          type: integer
          minimum: 1
          maximum: 4320
          description: Duration that the presigned download URL is valid in minutes.
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    DownloadContext:
      type: string
      description: >
        Selects which dataset the download request exports. The request and
        polling flow are

        identical for every value — only the returned data differs. The contexts
        below use the

        same catalog as the [Working with
        Downloads](/developer-docs/api-reference/working-with-downloads)

        guide, which also documents the filter and sort grammar.


        | Group | `context` values | What it returns |

        |---|---|---|

        | Access Inventory | `accessInventoryIdentitiesV2`,
        `accessInventoryEmployeesV2`, `accessInventoryNhiV2`,
        `accessInventoryAccounts`, `accessInventoryApplicationAccountsV2`,
        `accessInventoryApplicationInstancesV2`, `accessInventoryGroupsV2`,
        `accessInventoryRolesV2`, `accessInventoryResourceInstancesV2` |
        Snapshots of who has access to what, by identity / account / group /
        role. |

        | Identity & Employees | `identities`, `employees`,
        `employeeAccessInsights`, `oleriaUsers` | Canonical identity and HR
        records, plus per-employee access posture. |

        | Utilization | `accountUtilization`, `groupUtilizationAccounts` |
        Activity-weighted views of how access is actually used. |

        | Risk & Activity | `risks`, `risksV2`, `riskMonitoringDetail`,
        `activityAnalysis` | Detected risks, monitoring detail, and the raw
        activity log. |

        | Identity Assessments | `identityAssessmentRiskDownload`,
        `identityAssessmentEntitlementUtilization`,
        `identityAssessmentResourceInstanceUtilization`,
        `identityAssessmentSimilarGroups` | Periodic assessment outputs across
        entitlements and resources. |

        | Identity Lifecycle (ILM) | `ilmEmployeeEvents`,
        `ilmWorkflowEmployeeEvents`, `ilmEventAccountActions`,
        `ilmEventApplicationActions`, `ilmEventGroupActions` | Joiner / mover /
        leaver events, the workflows they triggered, and the per-event account /
        application / group provisioning actions performed for each one. |

        | External Access | `externalAccessUsers`, `externalAnonymousAccess`,
        `externalSharedAssets` | Third-party users, anonymous shares, and
        externally shared assets. |

        | Access Requests | `accessRequests` | Submitted access requests and
        their status. |

        | Reference | `resourceInstances`, `unmanagedApplications`,
        `applicationAccounts`, `userGroup` | Resource and application catalog
        data. |


        `oleriaUsers` is an administrative context, not customer-facing identity
        data.
      enum:
        - accessInventoryAccounts
        - accessInventoryApplicationAccountsV2
        - accessInventoryApplicationInstancesV2
        - accessInventoryEmployeesV2
        - accessInventoryGroupsV2
        - accessInventoryIdentitiesV2
        - accessInventoryNhiV2
        - accessInventoryResourceInstancesV2
        - accessInventoryRolesV2
        - accessRequests
        - accountUtilization
        - activityAnalysis
        - applicationAccounts
        - employeeAccessInsights
        - employees
        - externalAccessUsers
        - externalAnonymousAccess
        - externalSharedAssets
        - groupUtilizationAccounts
        - identities
        - identityAssessmentEntitlementUtilization
        - identityAssessmentResourceInstanceUtilization
        - identityAssessmentRiskDownload
        - identityAssessmentSimilarGroups
        - ilmEmployeeEvents
        - ilmEventAccountActions
        - ilmEventApplicationActions
        - ilmEventGroupActions
        - ilmWorkflowEmployeeEvents
        - oleriaUsers
        - resourceInstances
        - riskMonitoringDetail
        - risks
        - risksV2
        - unmanagedApplications
        - userGroup
    FileFormat:
      type: string
      description: >
        Selects the file format the download request exports. Defaults to `csv`
        when omitted.
      enum:
        - csv
        - jsonl
      default: csv
    Filter:
      type: object
      description: >
        A single filter applied to the data context before export; entries in

        `params.filterBy` are AND-combined. The valid `filterType` operators
        depend on the

        column's `dataType`:


        | `dataType` | Valid `filterType` operators |

        |---|---|

        | `string` | `eq`, `ne`, `in`, `notIn`, `contains`, `notContains`,
        `matches`, `isNull`, `isNotNull` |

        | `number` | `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`, `in`,
        `notIn`, `isNull`, `isNotNull` |

        | `boolean` | `eq`, `ne`, `isNull`, `isNotNull` |

        | `timestamp` | `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`, `last`,
        `isNull`, `isNotNull` |

        | `enum` | `eq`, `ne`, `in`, `notIn`, `isNull`, `isNotNull` |


        `between` and `in` take multiple `values`; `last` (timestamps only)
        takes a duration such as `7d` or `24h`.

        `isNull` and `isNotNull` take no operand — pass an empty list (`values:
        []`) to satisfy the schema's

        `values` requirement.
      required:
        - dataType
        - field
        - filterType
        - values
      properties:
        dataType:
          type: string
          enum:
            - boolean
            - number
            - string
            - timestamp
            - enum
        field:
          type: string
        filterType:
          type: string
          enum:
            - between
            - contains
            - eq
            - gt
            - gte
            - in
            - isNotNull
            - isNull
            - last
            - lt
            - lte
            - matches
            - ne
            - notContains
            - notIn
        values:
          type: array
          items:
            type: string
    SortBy:
      type: object
      required:
        - field
        - sortType
      properties:
        field:
          type: string
        sortType:
          type: string
          enum:
            - asc
            - desc
          default: asc
    DownloadRequestStatus:
      type: string
      enum:
        - accepted
        - completed
        - failed
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.example.oleria.io/oauth2/token
          scopes:
            ClientCredentialsResourceServer/client_credentials_base_scope: >-
              Default scope used for all client credentials (RBAC is controlled
              via permissions in the bearer token)

````