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

# Request an audit-log CSV export

> Request a CSV export of your enterprise audit log for any date range since July 1, 2026, optionally filtered by member, group or folder. Returns the report ID to poll.



## OpenAPI

````yaml post /v1/analytics/audit-logs/export
openapi: 3.0.0
info:
  description: >-
    The Magnific API is your gateway to a vast collection of high-quality
    digital resources for your applications and projects. As a leading platform,
    it offers a wide range of graphics, including vectors, photos,
    illustrations, icons, PSD templates, and more, all curated by talented
    designers from around the world.
  title: Magnific API
  version: 1.0.0
servers:
  - description: B2B API Production V1
    url: https://api.magnific.com
security:
  - magnificApiKey: []
paths:
  /v1/analytics/audit-logs/export:
    post:
      tags:
        - Analytics
      summary: Request an audit-log CSV export
      description: >
        Starts an asynchronous export of the audit-log events of the caller's
        enterprise team

        and returns the identifier of the report that will hold it. The export
        is the same one

        the dashboard offers under **Audit logs → Export**.


        It is the way to read history the events feed cannot reach: the feed
        serves windows of

        at most 30 days, while an export has no limit on the span of its range
        and goes back to

        **2026-07-01**, the day audit data collection started.


        The flow has three steps:

        1. `POST /v1/analytics/audit-logs/export` — returns `202` with the
        report `id`.

        2. `GET /v1/analytics/audit-logs/reports?reference={id}` — poll until
        `status` is
           `completed` (or `failed`).
        3. `GET /v1/analytics/audit-logs/reports/{reference}/download-url` —
        returns a
           short-lived URL to download the file.

        Authenticates via API key (`X-Magnific-API-Key` header). The caller's
        enterprise team

        and identity are resolved automatically from the API key. Available
        exclusively for

        Enterprise plans with audit logs enabled, and only to team members
        allowed to access

        audit logs (**admins/owners**). A key of another plan, or of a member
        without that

        access, gets `403`.


        Errors answered by the API carry a machine-readable `code` next to
        `message`

        (`invalid_request`, `forbidden`, `not_found`, `report_not_ready`...).
        Requests rejected

        before they reach it carry only `message`: a missing or unknown API key
        (`401`), a key

        that is not an enterprise one (`403`) and the daily limit (`429`).


        Dates are calendar days in UTC and both ends are inclusive. With no
        body, the export

        covers the last 14 days up to today. A `to` later than today is
        accepted, not rejected:

        the report keeps that range and holds the events that exist when it is
        generated. Every request creates a new report, even when an

        identical one already exists. The member the API key belongs to is
        recorded as the

        requester and is notified when the report is ready. Requesting an export
        is

        itself recorded in the audit log.


        Requests count against the audit-logs daily limit of 50,000 requests per
        API key, shared

        with the events feed and the other export endpoints. Exporting costs no
        credits.


        There is no limit on exports in progress today beyond that daily one.
        One may be added

        per team, and it will answer `429`: treat any `429` as "retry later" and
        wait for the

        exports already requested to finish before asking for more.
      requestBody:
        content:
          application/json:
            examples:
              date_range:
                summary: Everything in a date range
                value:
                  from: '2026-07-01T00:00:00.000Z'
                  to: '2026-09-30T00:00:00.000Z'
              filtered:
                summary: Only some members, groups and folders
                value:
                  from: '2026-10-01T00:00:00.000Z'
                  to: '2026-10-31T00:00:00.000Z'
                  filters:
                    users:
                      - 10499812
                    groups:
                      - 10
                      - 20
                    folders:
                      - a1b2c3d4-1111-4000-8000-000000000001
            schema:
              $ref: '#/components/schemas/audit-log-export-request'
        required: false
      responses:
        '202':
          content:
            application/json:
              examples:
                accepted:
                  summary: Report queued
                  value:
                    id: 0b6f1c9e-4a57-4d0e-9d55-7c1e2f3a4b5c
              schema:
                $ref: >-
                  #/components/schemas/_v1_analytics_audit_logs_export_post_202_response
          description: Accepted - the report was created and its generation queued.
        '400':
          content:
            application/json:
              examples:
                invalid_from:
                  summary: '`from` is not a YYYY-MM-DD date'
                  value:
                    code: invalid_request
                    message: 'Invalid "from" date. Expected format: Y-m-d'
                invalid_to:
                  summary: '`to` is not a YYYY-MM-DD date'
                  value:
                    code: invalid_request
                    message: 'Invalid "to" date. Expected format: Y-m-d'
                from_after_to:
                  summary: '`from` is later than `to`'
                  value:
                    code: invalid_request
                    message: '"from" date must be earlier than or equal to "to" date'
                from_before_first_day:
                  summary: '`from` is earlier than 2026-07-01'
                  value:
                    code: invalid_request
                    message: >-
                      "from" date cannot be earlier than 2026-07-01, when audit
                      data collection started
                invalid_users:
                  summary: >-
                    `filters.users` holds something that is not a positive
                    integer
                  value:
                    code: invalid_request
                    message: '"filters.users" must contain positive integer ids'
                invalid_groups:
                  summary: >-
                    `filters.groups` holds something that is not a positive
                    integer
                  value:
                    code: invalid_request
                    message: '"filters.groups" must contain positive integer ids'
                invalid_folders:
                  summary: >-
                    `filters.folders` holds something that is not a non-empty
                    string
                  value:
                    code: invalid_request
                    message: '"filters.folders" must contain non-empty string references'
              schema:
                $ref: '#/components/schemas/audit-log-error'
          description: Bad Request - the date range or the filters are not valid.
        '403':
          content:
            application/json:
              examples:
                key_not_enterprise:
                  summary: The API key is not an enterprise one
                  value:
                    message: You are not authorized to access this endpoint.
              schema:
                $ref: '#/components/schemas/audit-log-forbidden-error'
          description: >-
            Forbidden - the API key is not an enterprise one, or the member it
            belongs to is not allowed to access audit logs. The first case is
            answered before the request reaches the API and carries only
            `message`; the second carries `code: forbidden` too.
        '429':
          $ref: '#/components/responses/429-too-many-requests'
        '500':
          $ref: '#/components/responses/500-internal-server-error'
        '503':
          $ref: '#/components/responses/503-service-unavailable'
components:
  schemas:
    audit-log-export-request:
      description: Range and filters of an audit-log export. Every property is optional.
      properties:
        from:
          description: >-
            First day of the export (YYYY-MM-DD, UTC, inclusive). Cannot be
            earlier than 2026-07-01 nor later than `to`. Defaults to 14 days
            before `to`.
          example: '2026-07-01T00:00:00.000Z'
          format: date
          type: string
        to:
          description: >-
            Last day of the export (YYYY-MM-DD, UTC, inclusive). Defaults to
            today. There is no upper bound: a later day is accepted and the
            export holds the events that exist when it is generated.
          example: '2026-09-30T00:00:00.000Z'
          format: date
          type: string
        filters:
          $ref: '#/components/schemas/audit-log-export-filters'
      type: object
    _v1_analytics_audit_logs_export_post_202_response:
      example:
        id: 0b6f1c9e-4a57-4d0e-9d55-7c1e2f3a4b5c
      properties:
        id:
          description: >-
            Reference of the report. Use it as `reference` to poll its status
            and to get its download URL.
          example: 0b6f1c9e-4a57-4d0e-9d55-7c1e2f3a4b5c
          format: uuid
          type: string
      required:
        - id
      type: object
    audit-log-error:
      description: Error answered by the audit-logs export endpoints.
      example:
        code: invalid_request
        message: message
      properties:
        code:
          description: >-
            Machine-readable error code, stable across releases. Branch on this,
            not on `message`.
          example: invalid_request
          type: string
        message:
          description: Human-readable explanation. Its wording may change.
          type: string
      required:
        - code
        - message
      type: object
    audit-log-forbidden-error:
      description: >-
        `403` of the audit-logs export endpoints. `code` is missing when the
        request is rejected before it reaches the API (an API key that is not an
        enterprise one).
      example:
        code: forbidden
        message: message
      properties:
        code:
          description: >-
            Machine-readable error code. `forbidden` when the member is not
            allowed to access audit logs.
          example: forbidden
          type: string
        message:
          description: Human-readable explanation. Its wording may change.
          type: string
      required:
        - message
      type: object
    audit-log-export-filters:
      description: >-
        Narrows the export. An event must match every filter that is set; within
        one filter, any of its values. Repeated values are ignored. An absent or
        empty filter does not narrow.
      properties:
        users:
          description: Only events whose actor is one of these user IDs.
          example:
            - 10499812
          items:
            minimum: 1
            type: integer
          type: array
        groups:
          description: Only events of these team group IDs.
          example:
            - 10
            - 20
          items:
            minimum: 1
            type: integer
          type: array
        folders:
          description: Only events of these folder (project) references.
          example:
            - a1b2c3d4-1111-4000-8000-000000000001
          items:
            minLength: 1
            type: string
          type: array
      type: object
    inline_object:
      example:
        message: message
        request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
      properties:
        request_id:
          description: >-
            Identifier of the HTTP request, the same value as the `X-Request-Id`
            response header. The API gateway adds it to every error response of
            the public API (`/v1` on `api.magnific.com` and `api.magnific.com`),
            so it is absent when a service is called directly, without the
            gateway. Include it when you contact support. It identifies the
            request, not a task.
          example: ak-97f5c07b9dd04324842b8f8b55a0edf1
          type: string
        message:
          type: string
      type: object
    inline_object_2:
      example:
        message: Internal Server Error
        request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
      properties:
        request_id:
          description: >-
            Identifier of the HTTP request, the same value as the `X-Request-Id`
            response header. The API gateway adds it to every error response of
            the public API (`/v1` on `api.magnific.com` and `api.magnific.com`),
            so it is absent when a service is called directly, without the
            gateway. Include it when you contact support. It identifies the
            request, not a task.
          example: ak-97f5c07b9dd04324842b8f8b55a0edf1
          type: string
        message:
          example: Internal Server Error
          type: string
      type: object
    inline_object_3:
      example:
        message: Service Unavailable. Please try again later.
        request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
      properties:
        request_id:
          description: >-
            Identifier of the HTTP request, the same value as the `X-Request-Id`
            response header. The API gateway adds it to every error response of
            the public API (`/v1` on `api.magnific.com` and `api.magnific.com`),
            so it is absent when a service is called directly, without the
            gateway. Include it when you contact support. It identifies the
            request, not a task.
          example: ak-97f5c07b9dd04324842b8f8b55a0edf1
          type: string
        message:
          example: Service Unavailable. Please try again later.
          type: string
      type: object
  responses:
    429-too-many-requests:
      content:
        application/json:
          examples:
            generic:
              summary: Generic message for 429 errors
              value:
                request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
                message: Too many requests
            download_limit_reached:
              summary: The download limits has been reached.
              value:
                request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
                message: >-
                  The user can't download more items because the download limits
                  has been reached.
            edit_limit_reached:
              summary: Free user icon edit limits has been reached.
              value:
                request_id: ak-97f5c07b9dd04324842b8f8b55a0edf1
                message: Limit for free users reached.
          schema:
            $ref: '#/components/schemas/inline_object'
      description: >-
        Too Many Requests - The client has sent too many requests in a given
        amount of time.
    500-internal-server-error:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_object_2'
      description: >-
        Internal Server Error - The server has encountered a situation it
        doesn't know how to handle.
    503-service-unavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_object_3'
      description: Service Unavailable
  securitySchemes:
    magnificApiKey:
      description: >
        Your Magnific API key. Required for authentication. [Learn how to obtain
        an API key](https://docs.magnific.com/quickstart)
      in: header
      name: x-magnific-api-key
      type: apiKey

````

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