Class RecordsClient

java.lang.Object
ai.vectros.resources.records.RecordsClient

public class RecordsClient extends Object
  • Field Details

  • Constructor Details

    • RecordsClient

      public RecordsClient(ClientOptions clientOptions)
  • Method Details

    • withRawResponse

      public RawRecordsClient withRawResponse()
      Get responses with HTTP metadata like headers
    • batchGetRecords

      public BatchGetResponse batchGetRecords()
      Reserved endpoint for fetching multiple records by ID in one call. When available, the response will contain only the records you can see; any IDs that do not exist or are outside your scope are silently omitted (there is no per-ID existence signal), matching the not-found behavior of the single-record GET. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchGetRecords

      public BatchGetResponse batchGetRecords(RequestOptions requestOptions)
      Reserved endpoint for fetching multiple records by ID in one call. When available, the response will contain only the records you can see; any IDs that do not exist or are outside your scope are silently omitted (there is no per-ID existence signal), matching the not-found behavior of the single-record GET. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchGetRecords

      public BatchGetResponse batchGetRecords(BatchGetRequest request)
      Reserved endpoint for fetching multiple records by ID in one call. When available, the response will contain only the records you can see; any IDs that do not exist or are outside your scope are silently omitted (there is no per-ID existence signal), matching the not-found behavior of the single-record GET. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchGetRecords

      public BatchGetResponse batchGetRecords(BatchGetRequest request, RequestOptions requestOptions)
      Reserved endpoint for fetching multiple records by ID in one call. When available, the response will contain only the records you can see; any IDs that do not exist or are outside your scope are silently omitted (there is no per-ID existence signal), matching the not-found behavior of the single-record GET. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchLookupRecords

      public BatchLookupResponse batchLookupRecords()
      Reserved endpoint for batch lookup and reference resolution. The published response shape correlates results to each input and carries a per-item status envelope. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchLookupRecords

      public BatchLookupResponse batchLookupRecords(RequestOptions requestOptions)
      Reserved endpoint for batch lookup and reference resolution. The published response shape correlates results to each input and carries a per-item status envelope. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchLookupRecords

      public BatchLookupResponse batchLookupRecords(BatchLookupRequest request)
      Reserved endpoint for batch lookup and reference resolution. The published response shape correlates results to each input and carries a per-item status envelope. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchLookupRecords

      public BatchLookupResponse batchLookupRecords(BatchLookupRequest request, RequestOptions requestOptions)
      Reserved endpoint for batch lookup and reference resolution. The published response shape correlates results to each input and carries a per-item status envelope. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the records:r scope.
    • batchWriteRecords

      public BatchWriteResponse batchWriteRecords()
      Reserved endpoint for bulk record writes. The published response shape includes a per-item partial-failure envelope and an atomicity flag. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available, published now so SDK integrations against it will not break when it ships. Requires the records:c scope.
    • batchWriteRecords

      public BatchWriteResponse batchWriteRecords(RequestOptions requestOptions)
      Reserved endpoint for bulk record writes. The published response shape includes a per-item partial-failure envelope and an atomicity flag. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available, published now so SDK integrations against it will not break when it ships. Requires the records:c scope.
    • batchWriteRecords

      public BatchWriteResponse batchWriteRecords(BatchWriteRequest request)
      Reserved endpoint for bulk record writes. The published response shape includes a per-item partial-failure envelope and an atomicity flag. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available, published now so SDK integrations against it will not break when it ships. Requires the records:c scope.
    • batchWriteRecords

      public BatchWriteResponse batchWriteRecords(BatchWriteRequest request, RequestOptions requestOptions)
      Reserved endpoint for bulk record writes. The published response shape includes a per-item partial-failure envelope and an atomicity flag. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available, published now so SDK integrations against it will not break when it ships. Requires the records:c scope.
    • listRecords

      public RecordPage listRecords()
      Returns a paginated list of records in your account as a {data, nextCursor} page. Supply exactly one of type, folderId, or recent=true to choose the mode: type lists all records of a single type; folderId lists all records in a folder (any type); and recent=true returns the account-wide recently-updated feed across all types, newest first. You may combine type with folderId to list a single type within a folder. The owner filters (userId, orgId, clientId) further narrow the type and folder modes; the recent feed is standalone and ignores all filters. Each token only sees the record types it is scoped to read. Requires the records:r scope. By default the response returns the indexed projection of each record; set includePayload=true to include full payloads.
    • listRecords

      public RecordPage listRecords(RequestOptions requestOptions)
      Returns a paginated list of records in your account as a {data, nextCursor} page. Supply exactly one of type, folderId, or recent=true to choose the mode: type lists all records of a single type; folderId lists all records in a folder (any type); and recent=true returns the account-wide recently-updated feed across all types, newest first. You may combine type with folderId to list a single type within a folder. The owner filters (userId, orgId, clientId) further narrow the type and folder modes; the recent feed is standalone and ignores all filters. Each token only sees the record types it is scoped to read. Requires the records:r scope. By default the response returns the indexed projection of each record; set includePayload=true to include full payloads.
    • listRecords

      public RecordPage listRecords(ListRecordsRequest request)
      Returns a paginated list of records in your account as a {data, nextCursor} page. Supply exactly one of type, folderId, or recent=true to choose the mode: type lists all records of a single type; folderId lists all records in a folder (any type); and recent=true returns the account-wide recently-updated feed across all types, newest first. You may combine type with folderId to list a single type within a folder. The owner filters (userId, orgId, clientId) further narrow the type and folder modes; the recent feed is standalone and ignores all filters. Each token only sees the record types it is scoped to read. Requires the records:r scope. By default the response returns the indexed projection of each record; set includePayload=true to include full payloads.
    • listRecords

      public RecordPage listRecords(ListRecordsRequest request, RequestOptions requestOptions)
      Returns a paginated list of records in your account as a {data, nextCursor} page. Supply exactly one of type, folderId, or recent=true to choose the mode: type lists all records of a single type; folderId lists all records in a folder (any type); and recent=true returns the account-wide recently-updated feed across all types, newest first. You may combine type with folderId to list a single type within a folder. The owner filters (userId, orgId, clientId) further narrow the type and folder modes; the recent feed is standalone and ignores all filters. Each token only sees the record types it is scoped to read. Requires the records:r scope. By default the response returns the indexed projection of each record; set includePayload=true to include full payloads.
    • createRecord

      public RecordResponse createRecord()
      Creates a new record of a given type. The payload is validated against that type's schema before the record is stored. Identify the type by sending typeName, schemaId, or both (they must agree); if you send only schemaId, the type is taken from that schema. Optionally supply an externalId to make the create idempotent — if a record with the same externalId already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the records:c:<type> scope.
    • createRecord

      public RecordResponse createRecord(RequestOptions requestOptions)
      Creates a new record of a given type. The payload is validated against that type's schema before the record is stored. Identify the type by sending typeName, schemaId, or both (they must agree); if you send only schemaId, the type is taken from that schema. Optionally supply an externalId to make the create idempotent — if a record with the same externalId already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the records:c:<type> scope.
    • createRecord

      public RecordResponse createRecord(RecordRequest request)
      Creates a new record of a given type. The payload is validated against that type's schema before the record is stored. Identify the type by sending typeName, schemaId, or both (they must agree); if you send only schemaId, the type is taken from that schema. Optionally supply an externalId to make the create idempotent — if a record with the same externalId already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the records:c:<type> scope.
    • createRecord

      public RecordResponse createRecord(RecordRequest request, RequestOptions requestOptions)
      Creates a new record of a given type. The payload is validated against that type's schema before the record is stored. Identify the type by sending typeName, schemaId, or both (they must agree); if you send only schemaId, the type is taken from that schema. Optionally supply an externalId to make the create idempotent — if a record with the same externalId already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the records:c:<type> scope.
    • getRecord

      public RecordResponse getRecord(String id)
      Retrieves a single record by its Vectros-assigned ID, including its full payload (payloads that were externalized to object storage are rehydrated for this response). Sensitive fields are masked according to the record's schema. Requires the records:r:<type> scope. A record outside your account or scope returns 404 (not found) rather than revealing its existence.
    • getRecord

      public RecordResponse getRecord(String id, RequestOptions requestOptions)
      Retrieves a single record by its Vectros-assigned ID, including its full payload (payloads that were externalized to object storage are rehydrated for this response). Sensitive fields are masked according to the record's schema. Requires the records:r:<type> scope. A record outside your account or scope returns 404 (not found) rather than revealing its existence.
    • getRecord

      public RecordResponse getRecord(String id, GetRecordRequest request)
      Retrieves a single record by its Vectros-assigned ID, including its full payload (payloads that were externalized to object storage are rehydrated for this response). Sensitive fields are masked according to the record's schema. Requires the records:r:<type> scope. A record outside your account or scope returns 404 (not found) rather than revealing its existence.
    • getRecord

      public RecordResponse getRecord(String id, GetRecordRequest request, RequestOptions requestOptions)
      Retrieves a single record by its Vectros-assigned ID, including its full payload (payloads that were externalized to object storage are rehydrated for this response). Sensitive fields are masked according to the record's schema. Requires the records:r:<type> scope. A record outside your account or scope returns 404 (not found) rather than revealing its existence.
    • updateRecord

      public RecordResponse updateRecord(String id, UpdateRecordRequest request)
      Replaces a record's payload and mutable fields. This is a full replacement: the payload you send overwrites the existing payload entirely, so include every field you want to keep (use the PATCH endpoint to change only specific fields). typeName and schemaId are immutable and cannot be changed. The new payload is validated against the record's schema. Pass expectedVersion to make the update conditional on the record not having changed since you last read it (optimistic concurrency). Requires the records:u:<type> scope.
    • updateRecord

      public RecordResponse updateRecord(String id, UpdateRecordRequest request, RequestOptions requestOptions)
      Replaces a record's payload and mutable fields. This is a full replacement: the payload you send overwrites the existing payload entirely, so include every field you want to keep (use the PATCH endpoint to change only specific fields). typeName and schemaId are immutable and cannot be changed. The new payload is validated against the record's schema. Pass expectedVersion to make the update conditional on the record not having changed since you last read it (optimistic concurrency). Requires the records:u:<type> scope.
    • deleteRecord

      public void deleteRecord(String id)
      Permanently deletes a record. This is a hard delete: the record is removed and a tombstone plus an audit-trail entry are recorded (you can later retrieve the tombstone via GET /v1/records/{id}/tombstone). Requires the records:d:<type> scope.
    • deleteRecord

      public void deleteRecord(String id, RequestOptions requestOptions)
      Permanently deletes a record. This is a hard delete: the record is removed and a tombstone plus an audit-trail entry are recorded (you can later retrieve the tombstone via GET /v1/records/{id}/tombstone). Requires the records:d:<type> scope.
    • deleteRecord

      public void deleteRecord(String id, DeleteRecordRequest request)
      Permanently deletes a record. This is a hard delete: the record is removed and a tombstone plus an audit-trail entry are recorded (you can later retrieve the tombstone via GET /v1/records/{id}/tombstone). Requires the records:d:<type> scope.
    • deleteRecord

      public void deleteRecord(String id, DeleteRecordRequest request, RequestOptions requestOptions)
      Permanently deletes a record. This is a hard delete: the record is removed and a tombstone plus an audit-trail entry are recorded (you can later retrieve the tombstone via GET /v1/records/{id}/tombstone). Requires the records:d:<type> scope.
    • patchRecord

      public RecordResponse patchRecord(String id, PatchRecordRequest request)
      Partially updates a record using an RFC 7386 JSON Merge Patch. The payload object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (status, folderId, userId, orgId, clientId) are set when present and left unchanged when omitted; sending a top-level field as null is rejected (clearing a top-level field is not supported in this release — omit it instead). typeName, schemaId, externalId, and indexMode are immutable and rejected if present. The merged result is validated against the schema. Pass expectedVersion to make the patch conditional (optimistic concurrency, 409 on conflict). Requires the records:u:<type> scope.
    • patchRecord

      public RecordResponse patchRecord(String id, PatchRecordRequest request, RequestOptions requestOptions)
      Partially updates a record using an RFC 7386 JSON Merge Patch. The payload object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (status, folderId, userId, orgId, clientId) are set when present and left unchanged when omitted; sending a top-level field as null is rejected (clearing a top-level field is not supported in this release — omit it instead). typeName, schemaId, externalId, and indexMode are immutable and rejected if present. The merged result is validated against the schema. Pass expectedVersion to make the patch conditional (optimistic concurrency, 409 on conflict). Requires the records:u:<type> scope.
    • lookupRecords

      public RecordLookupResponse lookupRecords(LookupRecordsRequest request)
      Finds records by the value of a lookup field declared on the type's schema. Provide exactly one lookup mode: value (exact match), from+to (inclusive range, ascending by value), or prefix (string fields only, ascending). Range and prefix lookups are not supported on a sensitive field, because its value is stored as a blind index and has no sortable order. An exact-value lookup on a sensitive field is also rejected on this GET endpoint — the value must not appear in the URL — so use the POST /v1/records/lookup body variant for sensitive fields. Results are paginated: set limit for the page size and pass the returned nextCursor back as startFrom for the next page. Requires the records:r:<type> scope.
    • lookupRecords

      public RecordLookupResponse lookupRecords(LookupRecordsRequest request, RequestOptions requestOptions)
      Finds records by the value of a lookup field declared on the type's schema. Provide exactly one lookup mode: value (exact match), from+to (inclusive range, ascending by value), or prefix (string fields only, ascending). Range and prefix lookups are not supported on a sensitive field, because its value is stored as a blind index and has no sortable order. An exact-value lookup on a sensitive field is also rejected on this GET endpoint — the value must not appear in the URL — so use the POST /v1/records/lookup body variant for sensitive fields. Results are paginated: set limit for the page size and pass the returned nextCursor back as startFrom for the next page. Requires the records:r:<type> scope.
    • lookupRecordsByBody

      public RecordLookupResponse lookupRecordsByBody(RecordLookupRequest request)
      Body-based equivalent of GET /v1/records/lookup. Use this when looking up by a sensitive field: the value travels in the request body (and is blind-indexed server-side) instead of in the URL query string, so it never lands in access, CDN, or proxy logs. The GET variant rejects an exact-value lookup on a sensitive field and directs you here. Non-sensitive exact-value, range (from+to), and prefix lookups also work here. Returns the same {data, nextCursor} envelope and uses the same pagination as the GET variant. Requires the records:r:<type> scope.
    • lookupRecordsByBody

      public RecordLookupResponse lookupRecordsByBody(RecordLookupRequest request, RequestOptions requestOptions)
      Body-based equivalent of GET /v1/records/lookup. Use this when looking up by a sensitive field: the value travels in the request body (and is blind-indexed server-side) instead of in the URL query string, so it never lands in access, CDN, or proxy logs. The GET variant rejects an exact-value lookup on a sensitive field and directs you here. Non-sensitive exact-value, range (from+to), and prefix lookups also work here. Returns the same {data, nextCursor} envelope and uses the same pagination as the GET variant. Requires the records:r:<type> scope.
    • getRecordTombstone

      public RecordResponse getRecordTombstone(String id)
      Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the records:r:<type> scope.
    • getRecordTombstone

      public RecordResponse getRecordTombstone(String id, RequestOptions requestOptions)
      Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the records:r:<type> scope.
    • getRecordTombstone

      public RecordResponse getRecordTombstone(String id, GetRecordTombstoneRequest request)
      Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the records:r:<type> scope.
    • getRecordTombstone

      public RecordResponse getRecordTombstone(String id, GetRecordTombstoneRequest request, RequestOptions requestOptions)
      Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the records:r:<type> scope.
    • getRecordVersions

      public ModelDataVersionPage getRecordVersions(String id)
      Returns the audit trail of past versions for a record, as a paginated {data, nextCursor} page. This is available only when the record type's schema has audit history enabled (the default); if it is disabled, the endpoint returns 409. Requires the records:r:<type> scope.
    • getRecordVersions

      public ModelDataVersionPage getRecordVersions(String id, RequestOptions requestOptions)
      Returns the audit trail of past versions for a record, as a paginated {data, nextCursor} page. This is available only when the record type's schema has audit history enabled (the default); if it is disabled, the endpoint returns 409. Requires the records:r:<type> scope.
    • getRecordVersions

      public ModelDataVersionPage getRecordVersions(String id, GetRecordVersionsRequest request)
      Returns the audit trail of past versions for a record, as a paginated {data, nextCursor} page. This is available only when the record type's schema has audit history enabled (the default); if it is disabled, the endpoint returns 409. Requires the records:r:<type> scope.
    • getRecordVersions

      public ModelDataVersionPage getRecordVersions(String id, GetRecordVersionsRequest request, RequestOptions requestOptions)
      Returns the audit trail of past versions for a record, as a paginated {data, nextCursor} page. This is available only when the record type's schema has audit history enabled (the default); if it is disabled, the endpoint returns 409. Requires the records:r:<type> scope.