TrustLayer Request Records API

The Request Records API from TrustLayer — 7 operation(s) for request records.

OpenAPI Specification

trustlayer-request-records-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: TrustLayer Platform Auth Request Records API
  version: '1.0'
  contact:
    name: TrustLayer Support
    email: support@trustlayer.io
  termsOfService: https://trustlayer.io/terms-of-service
  externalDocs:
    description: OpenAPI specification
    url: /v1/platform-api.yaml
  description: '3rd-party API for the TrustLayer platform.


    **Deprecated.** Platform API v1 is deprecated as of 01 June 2026 and is

    scheduled for sunset (end-of-life) on 31 March 2027. It remains fully

    available until the sunset date but will not receive new features. Please

    migrate to Platform API v2 for new integrations.


    All v1 responses carry the standard deprecation response headers

    ([RFC 8594](https://www.rfc-editor.org/rfc/rfc8594)):


    ```http

    Deprecation: @1780272000

    Sunset: Wed, 31 Mar 2027 23:59:59 GMT

    Link: <https://developers.trustlayer.io/>; rel="deprecation", <https://developers.trustlayer.io/>; rel="sunset"

    ```


    `Deprecation: @1780272000` is the Unix timestamp for 2026-06-01T00:00:00Z;

    sunset (end-of-life) is 2027-03-31T23:59:59 GMT.'
  x-deprecated: true
  x-deprecation-date: '2026-06-01'
  x-sunset: '2027-03-31'
  license:
    name: Apache 2.0
    url: https://apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:4000/v1
  description: Local
- url: https://api.trustlayer.io/v1
  description: Production
security:
- API Key: []
tags:
- name: Request Records
  description: ''
paths:
  /request-records:
    get:
      tags:
      - Request Records
      description: 'List request records in the caller''s organization. Results are always scoped to the caller''s organization. Supports pagination via `limit` and `skip`.


        <!-- qs2mongo:list-summary -->


        **Filtering**: `_id` (objectId), `createdAt` (date), `updatedAt` (date), `primaryRecordId` (objectId), `contextRecordId` (objectId), `name` (string), `status` (string), `complianceTracking` (string), `complianceStatus` (string), `complianceProfile.complianceProfileId` (objectId). See "List Endpoints" in the API overview for operator syntax and combining rules.


        **Sorting**: supported via `sort` (see the parameter''s description for allowed fields). Prefix with `-` for descending.


        **Field projection**: supported via `fields` (see the parameter''s description for allowed fields).'
      parameters:
      - schema:
          default: 20
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 100
        in: query
        name: limit
        required: false
      - schema:
          default: 0
          type: integer
          minimum: 0
          maximum: 9007199254740991
        in: query
        name: skip
        required: false
      - schema:
          type: string
          minLength: 1
        in: query
        name: sort
        required: false
        description: 'Comma-separated list of fields to sort by. Example: ''_id,-createdAt''. Allowed: contextRecordId, name, status, complianceTracking, complianceStatus, createdAt, updatedAt'
      - schema:
          type: string
          minLength: 1
        in: query
        name: fields
        required: false
        description: 'Comma-separated list of fields to project. Allowed: _id, organization, primaryRecordId, contextRecordId, name, status, complianceTracking, complianceProfile, complianceStatus, createdAt, updatedAt, complianceModules'
      - schema:
          type: string
        in: query
        name: _id
        required: false
        description: Filter by _id. 24-character hex ObjectId string (e.g. `_id=507f1f77bcf86cd799439011`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: createdAt
        required: false
        description: Filter by createdAt. ISO-8601 date or datetime string (e.g. `createdAt=2024-01-15`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: updatedAt
        required: false
        description: Filter by updatedAt. ISO-8601 date or datetime string (e.g. `updatedAt=2024-01-15`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: primaryRecordId
        required: false
        description: Filter by primaryRecordId. 24-character hex ObjectId string (e.g. `primaryRecordId=507f1f77bcf86cd799439011`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: contextRecordId
        required: false
        description: Filter by contextRecordId. 24-character hex ObjectId string (e.g. `contextRecordId=507f1f77bcf86cd799439011`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: name
        required: false
        description: Filter by name. String value (e.g. `name=example`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: status
        required: false
        description: Filter by status. String value (e.g. `status=example`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: complianceTracking
        required: false
        description: Filter by complianceTracking. String value (e.g. `complianceTracking=example`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: complianceStatus
        required: false
        description: Filter by complianceStatus. String value (e.g. `complianceStatus=example`). See "List Endpoints" in the API overview for operator syntax.
      - schema:
          type: string
        in: query
        name: complianceProfile.complianceProfileId
        required: false
        description: Filter by complianceProfile.complianceProfileId. 24-character hex ObjectId string (e.g. `complianceProfile.complianceProfileId=507f1f77bcf86cd799439011`). See "List Endpoints" in the API overview for operator syntax.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          description: Unique identifier of the request record.
                          allOf:
                          - $ref: '#/components/schemas/objectId'
                        organization:
                          description: Identifier of the organization (workspace) that owns the request record. Always equal to the caller's organization.
                          allOf:
                          - $ref: '#/components/schemas/objectId'
                        primaryRecordId:
                          description: Identifier of the primary record this request record is assigned to.
                          allOf:
                          - $ref: '#/components/schemas/objectId'
                        contextRecordId:
                          description: Optional identifier of the context record (e.g. project) this request record is scoped to.
                          allOf:
                          - $ref: '#/components/schemas/objectId'
                        name:
                          description: Human-readable name of the request record.
                          type: string
                          minLength: 1
                        status:
                          type: string
                          enum:
                          - active
                          - archived
                          description: Lifecycle status of the request record.
                        complianceTracking:
                          type: boolean
                          description: Whether compliance tracking is enabled for this request record.
                        complianceProfile:
                          description: Compliance profile currently assigned to this request record, if any. Manage assignments via the `/compliance-profile` sub-routes.
                          type: object
                          properties:
                            id:
                              $ref: '#/components/schemas/objectId'
                            name:
                              type: string
                          required:
                          - id
                          additionalProperties: false
                        complianceStatus:
                          type: string
                          enum:
                          - non_compliant
                          - compliant
                          description: Computed compliance status of this request record, derived from its assigned compliance profile and submitted documents.
                        createdAt:
                          description: Timestamp at which the request record was created.
                          type: string
                          format: date-time
                        updatedAt:
                          description: Timestamp at which the request record was last updated.
                          type: string
                          format: date-time
                        complianceModules:
                          description: Compliance modules expanded by subject and requirement, populated from the assigned compliance profile. Returned only when explicitly requested via `?fields=complianceModules`.
                          type: array
                          items:
                            type: object
                            properties:
                              code:
                                type: string
                                minLength: 1
                                description: Stable identifier of this compliance module (e.g. general-liability).
                              label:
                                type: string
                                minLength: 1
                                description: Human-readable label of the module.
                              status:
                                type: string
                                enum:
                                - non_compliant
                                - compliant
                                description: Computed compliance status of this module.
                              documents:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      $ref: '#/components/schemas/objectId'
                                    origin:
                                      type: string
                                      enum:
                                      - upload
                                      - makeCompliant
                                      - connectedDocument
                                      - fillableForm
                                      - webForm
                                    complianceStatus:
                                      type: string
                                      enum:
                                      - compliant
                                      - non_compliant
                                  required:
                                  - id
                                  - complianceStatus
                                  additionalProperties: false
                                description: Documents associated with this module.
                              documentsCount:
                                type: number
                                description: Number of documents associated with this module.
                              subjects:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    code:
                                      type: string
                                      minLength: 1
                                      description: Stable identifier of this compliance subject.
                                    label:
                                      type: string
                                      minLength: 1
                                      description: Human-readable label of the subject (e.g. coverage limit, named insured).
                                    status:
                                      type: string
                                      enum:
                                      - compliant
                                      - non_compliant
                                      - waived
                                      - overridden
                                      description: Compliance status of this subject, computed across its requirements.
                                    notes:
                                      description: Free-form notes attached to the subject (internal use).
                                      type: string
                                      minLength: 1
                                    effectiveDate:
                                      description: Earliest effective date among documents in force for this subject — when the subject's continuous coverage begins. May be `AlwaysValid` for documents with always-valid coverage.
                                      anyOf:
                                      - type: string
                                        enum:
                                        - always_valid
                                    expirationDate:
                                      description: Latest expiration date among documents in force for this subject — when the subject's continuous coverage ends. May be `AlwaysValid` or overridden by a cancellation.
                                      anyOf:
                                      - type: string
                                        enum:
                                        - always_valid
                                    cancellation:
                                      description: Active cancellation that overrides this subject's expiration, if any.
                                      type: object
                                      properties:
                                        effectiveDate:
                                          type: string
                                          format: date-time
                                      required:
                                      - effectiveDate
                                      additionalProperties: false
                                    latestExpirationDate:
                                      description: Furthest future expiration date across all matching documents (not only those in force).
                                      anyOf:
                                      - type: string
                                        enum:
                                        - always_valid
                                    latestValidEffectiveDate:
                                      description: Most recent valid effective date recorded for this subject (last-known value preserved across recomputes).
                                      anyOf:
                                      - type: string
                                        enum:
                                        - always_valid
                                    latestValidExpirationDate:
                                      description: Most recent valid expiration date recorded for this subject (last-known value preserved across recomputes).
                                      anyOf:
                                      - type: string
                                        enum:
                                        - always_valid
                                    documentsCount:
                                      type: number
                                      description: Number of documents associated with this subject.
                                    resetOn:
                                      description: Timestamp at which the subject's computed state was last reset.
                                      type: string
                                      format: date-time
                                    validityStatus:
                                      type: string
                                      enum:
                                      - active
                                      - expiring
                                      - cancelling
                                      - expired
                                      - cancelled
                                      - inactive
                                      description: Validity classification of the subject (e.g. valid, expiring, expired).
                                    documents:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            $ref: '#/components/schemas/objectId'
                                          origin:
                                            type: string
                                            enum:
                                            - upload
                                            - makeCompliant
                                            - connectedDocument
                                            - fillableForm
                                            - webForm
                                          complianceStatus:
                                            type: string
                                            enum:
                                            - compliant
                                            - non_compliant
                                        required:
                                        - id
                                        - complianceStatus
                                        additionalProperties: false
                                      description: Documents associated with this subject.
                                    requirements:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          complianceProfile:
                                            type: object
                                            properties:
                                              id:
                                                $ref: '#/components/schemas/objectId'
                                              name:
                                                type: string
                                            required:
                                            - id
                                            additionalProperties: false
                                            description: Compliance profile this requirement was sourced from at the time the request record was assigned.
                                          id:
                                            description: Stable identifier of this requirement instance.
                                            allOf:
                                            - $ref: '#/components/schemas/objectId'
                                          moduleCode:
                                            type: string
                                            minLength: 1
                                            description: Identifier of the parent compliance module.
                                          moduleLabel:
                                            type: string
                                            minLength: 1
                                            description: Human-readable label of the parent compliance module.
                                          subjectCode:
                                            type: string
                                            minLength: 1
                                            description: Identifier of the parent subject within the module.
                                          subjectLabel:
                                            type: string
                                            minLength: 1
                                            description: Human-readable label of the parent subject.
                                          attributeCode:
                                            type: string
                                            minLength: 1
                                            description: Identifier of the attribute (specific check) this requirement evaluates.
                                          attributeLabel:
                                            description: Human-readable label of the attribute.
                                            type: string
                                            minLength: 1
                                          attributeDescription:
                                            description: Free-form description of the attribute, surfaced on document request pages.
                                            type: string
                                            minLength: 1
                                          matchingCriteria:
                                            type: string
                                            enum:
                                            - matchOnce
                                            - matchRepeatedly
                                            description: How the requirement matches against documents (e.g. once, on every document).
                                          operator:
                                            type: string
                                            enum:
                                            - must be present
                                            - must be greater or equal to
                                            - must be less than or equal to
                                            - must be completed by
                                            - at least one must be present from list
                                            description: Comparison operator applied between extracted document values and `targetValue`.
                                          targetValue:
                                            description: Target value(s) the document data is compared against.
                                            anyOf:
                                            - type: string
                                              minLength: 1
                                            - type: array
                                              items:
                                                type: string
                                                minLength: 1
                                          value:
                                            description: Resolved value extracted from a matching document, when one is present.
                                            anyOf:
                                            - type: string
                                              minLength: 1
                                            - type: number
                                          status:
                                            type: string
                                            enum:
                                            - compliant
                                            - non_compliant
                                            - waived
                                            - overridden
                                            - invalidated
                                            description: Computed compliance status of this requirement.
                                          invalidatedBy:
                                            description: Identifiers of conditions that invalidate this requirement, if any.
                                            type: array
                                            items:
                                              type: string
                                              minLength: 1
                                          notes:
                                            description: Internal-only notes (e.g. context for a waiver or override).
                                            type: string
                                            minLength: 1
                                          publicNotes:
                                            description: Public-facing notes shown alongside the requirement on the document request page.
                                            type: object
                                            properties:
                                              content:
                                                type: string
                                                minLength: 1
                                              removeWhenCompliant:
                                                type: boolean
                                            required:
                                            - content
                                            - removeWhenCompliant
                                            additionalProperties: false
                                          documents:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                id:
                                                  $ref: '#/components/schemas/objectId'
                                                origin:
                                                  type: string
                                                  enum:
                                                  - upload
                                                  - makeCompliant
                                                  - connectedDocument
                                                  - fillableForm
                                                  - webForm
                                                complianceStatus:
                                                  type: string
                                                  enum:
                                                  - compliant
                                                  - non_compliant
                                              required:
                                              - id
                                              - complianceStatus
                                              additionalProperties: false
                                            description: Documents associated with this requirement, with each document's contribution to compliance.
                                          documentsCount:
                                            type: number
                                            description: Number of documents associated with this requirement.
                                          resetOn:
                                            description: Timestamp at which the requirement's computed state was last reset.
                                            type: string
                                            format: date-time
                                          custom:
                                            type: boolean
                                            description: Whether this requirement was added as a workspace customization rather than from a built-in module.
                                        required:
                                        - complianceProfile
                                        - moduleCode
                                        - moduleLabel
                                        - subjectCode
                                        - subjectLabel
                                        - attributeCode
                                        - matchingCriteria
                                        - operator
                                        - status
                                        - documents
                                        - documentsCount
                                        - custom
                                        additionalProperties: false
                                        description: A single compliance requirement under a subject of a compliance module.
                                      description: Requirements grouped under this subject.
                                  required:
                                  - code
                                  - label
                                  - status
                                  - documentsCount
                                  - validityStatus
                                  - documents
                                  - requirements
                                  additionalProperties: false
                                  description: A subject within a compliance module (e.g. coverage limit, named insured).
                                description: Subjects expanded under this compliance module.
                            required:
                            - code
                            - label
                            - status
                            - documents
                            - documentsCount
                            - subjects
                            additionalProperties: false
                            description: A single compliance module from the assigned profile, expanded with its subjects and requirements.
                      required:
                      - _id
                      additionalProperties: false
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Total number of records matching the query, across all pages.
                      next:
                        description: Relative URL for the next page of results, preserving filters/sort/projection. Omitted on the last page.
                        type: string
                      prev:
                        description: Relative URL for the previous page of results, preserving filters/sort/projection. Omitted on the first page.
                        type: string
                    required:
                    - count
                    additionalProperties: false
                required:
                - data
                - meta
                additionalProperties: false
        '400':
          description: The request could not be understood — invalid body payload, unknown querystring filter, or a schema validation failure.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                    - 400
                  applicationCode:
                    type: string
                    description: Machine-readable error code. For application errors this is the ApplicationError.applicationCode (e.g. "FLOW.006"); for schema validation failures it is "FLOW.002" (InvalidData); for unexpected server failures it is "LIB.000".
                  message:
                    type: string
                    description: Human-readable error message.
                  details:
        

# --- truncated at 32 KB (210 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/trustlayer/refs/heads/main/openapi/trustlayer-request-records-api-openapi.yml