Class ApiKey

java.lang.Object
africa.sendbyte.apikeys.ApiKey

public final class ApiKey extends Object
An API key.

The full key is populated only on the ApiKeys.create(java.lang.String, africa.sendbyte.apikeys.KeyScope, africa.sendbyte.apikeys.KeyMode) response and is shown once. List responses instead expose a masked prefix.

  • Constructor Details

    • ApiKey

      public ApiKey()
  • Method Details

    • getId

      public String getId()
      Unique key identifier (prefixed key_); pass to ApiKeys.revoke(String).
    • setId

      public void setId(String id)
    • getName

      public String getName()
      The human-readable label assigned at creation.
    • setName

      public void setName(String name)
    • getKey

      public String getKey()
      The full API key string. Present only on the create response — store it immediately.
    • setKey

      public void setKey(String key)
    • getPrefix

      public String getPrefix()
      A masked prefix identifying the key (e.g. sk_live_84f8e388...). Present on list.
    • setPrefix

      public void setPrefix(String prefix)
    • getScope

      public String getScope()
      Raw scope string. See scope() for the typed value.
    • setScope

      public void setScope(String scope)
    • scope

      public KeyScope scope()
      The scope as a typed enum, mapping unknown values to KeyScope.UNKNOWN.
    • getMode

      public String getMode()
      Raw mode string. See mode() for the typed value.
    • setMode

      public void setMode(String mode)
    • mode

      public KeyMode mode()
      The mode as a typed enum, mapping unknown values to KeyMode.UNKNOWN.
    • getLastUsedAt

      public String getLastUsedAt()
      ISO 8601 timestamp of the most recent authenticated request, or null if unused.
    • setLastUsedAt

      public void setLastUsedAt(String lastUsedAt)
    • getCreatedAt

      public String getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(String createdAt)