Class ScopedKeyResponse

java.lang.Object
ai.vectros.types.ScopedKeyResponse

public final class ScopedKeyResponse extends Object
  • Method Details

    • getKeyId

      public Optional<String> getKeyId()
      Returns:
      Server-generated identifier for the key, stable for its entire lifetime. Pass this in the URL path of the get and revoke endpoints.
    • getRawKey

      public Optional<String> getRawKey()
      Returns:
      The raw secret key. Returned ONLY in the response to creating the key; all subsequent reads omit this field. Treat it as a sensitive credential and store it securely.
    • getKeyName

      public Optional<String> getKeyName()
      Returns:
      The human-readable name you gave the key when creating it.
    • getLabel

      public Optional<String> getLabel()
      Returns:
      Optional display label for the key, surfaced through /v1/ping as principalLabel. Omitted when no label was set.
    • getTenantId

      public Optional<String> getTenantId()
      Returns:
      The tenant the key operates on — either your live or your test environment.
    • getContextId

      public Optional<String> getContextId()
      Returns:
      The app context the key is bound to.
    • getUserId

      public Optional<String> getUserId()
      Returns:
      The user the key acts as. This is the same user ID used by the /v1/users endpoints.
    • getUserType

      public Optional<ScopedKeyResponseUserType> getUserType()
      Returns:
      The bound user's type: HUMAN or SERVICE. Included as a convenience for filtering in admin interfaces.
    • getStatus

      public Optional<ScopedKeyResponseStatus> getStatus()
      Returns:
      The key's lifecycle status: active or revoked.
    • getKeyType

      public Optional<ScopedKeyResponseKeyType> getKeyType()
      Returns:
      Always scoped for keys created through this endpoint. The field exists so this response shape can also represent unscoped (sk_*) keys.
    • getAccessProfileRef

      public Optional<String> getAccessProfileRef()
      Returns:
      Reference to the bound access profile, in the form tenant#context#usr_user (the user segment carries the usr_ prefix). Useful for cross-referencing the profile via /v1/app-contexts/{contextId}/profiles/{principalId}.
    • getCreatedAt

      public Optional<String> getCreatedAt()
      Returns:
      When the key was created, as an ISO-8601 UTC timestamp.
    • getRevokedAt

      public Optional<String> getRevokedAt()
      Returns:
      When the key was revoked, as an ISO-8601 UTC timestamp. Present only on revoked keys.
    • getLastUsedAt

      public Optional<String> getLastUsedAt()
      Returns:
      When the key was most recently used, as an ISO-8601 UTC timestamp. This value is coarse (updated at most about once an hour) and best-effort. Null if the key has not been used since usage tracking began.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static ScopedKeyResponse.Builder builder()