Skip to content
Sursa Developers

Objects

ApiKeyCreate

Fields

  • namestringrequired

    length ≥ 1, length ≤ 64

  • rolestring

    Default: "editor"

  • data_profilestring | null

    Data profile of the key. Without it, the key gets the default profile of the organization. A data profile does not apply to the admin role. An admin key sees all data of the organization, and a profile other than full returns 400 api_keys.data_profile_not_applicable.

  • expires_atstring (date-time) | null

    Expiration time of the key (ISO 8601, in the future). null or no value means the key does not expire.

  • scopesarray of ApiKeyScope | null

    Scopes of the key. If absent, the scopes follow the role: admin gets read, write, admin; editor and verifier get read, write; viewer gets read. The system scope is issued only by the installation administrator. Fine-grained resource:action scopes (ApiKeyScope) are accepted too; the earlier read, write and admin expand into sets of scopes.

  • collection_idsarray of integer | null

    Restricts the key to these collections of the organization. Cards, search, answers and events work only in them, on top of the role and the data profile. No value or an empty list means no restriction. If the calling key is itself restricted to collections, the new key can only be in its collections. Without this field, the new key gets the collections of the calling key. An empty list or a collection outside its list returns 400 api_keys.invalid_collections.

    items ≤ 100

  • allowed_cidrsarray of string | null

    Networks the key may be used from, such as 10.0.0.0/8 or 2001:db8::/32. A single address is a network of one address. A request from another address returns 403 api_keys.ip_not_allowed. No value means no restriction.

    items ≤ 50

Used by