v1 · OpenAPI 3.1Panel

API referansı İngilizcedir.

Secret keys

Create a secret key

POST/v1/applications/{app_id}/secret_keys

Creates another secret key for the application and returns it once, in key. Only its hash is stored, so save it right away. With one key per server or job, each gets the smallest role it needs and you can revoke one without changing the others.

Needs keys:write: a dashboard owner or admin, or an organization API key with that scope. The caller also needs every scope of the role it gives, or it gets 403 missing_scope. A secret key gets 403 secret_key_not_allowed.

Gereken yetki
keys:write
Kimlik doğrulama
Organization API key · Dashboard session

Yol parametreleri

  • app_idstringzorunlu

    Örnek: app_seller

Başlıklar

  • X-Fox-Tenantstring

    Required when authenticating with a dashboard session token instead of a tenant API key.

    Örnek: ten_8f2c91a7

Gövde application/json

  • namestring

    Shown in the dashboard. Missing or empty means Secret key.

    Varsayılan: Secret keyÖrnek: Billing worker

  • rolestring

    admin (Full access), editor (Read and write users) or viewer (Read only). The secretKey security scheme lists the scopes of each role.

    Değerler: admin editor viewerVarsayılan: admin

Yanıtlar

  • 201CreatedSecretKeyWithKey

    Created. The full key is returned only once.

    • idstring

      Örnek: key_3b7e10c2

    • namestring

      Örnek: Billing worker

    • rolestring

      admin (Full access), editor (Read and write users) or viewer (Read only). The secretKey security scheme lists the scopes of each role.

      Değerler: admin editor viewer

    • prefixstring

      Örnek: sk_live_eu_Q9xT

    • keystring

      The full key. Send it as Authorization: Bearer <key>.

      Örnek: sk_live_eu_Q9xTa7Lm2Nb4Vc6Xz8Sd1Fg3Hj5Kl7Pq9Wr2Ey4Tu6I

    • created_atstring (date-time)

    • created_bystringboş olabilir

      Örnek: usr_eu_8f2c91a7

    • last_used_atnull

  • 400Bad RequestError

    invalid_role (role must be admin, editor or viewer), invalid_name (more than 60 characters) or invalid_body.

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 401UnauthorizedError

    Missing or invalid key or token. The Management API answers missing_api_key (no Bearer token) or invalid_api_key (unknown or revoked secret key or organization API key).

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 403ForbiddenError

    missing_scope (the role or scopes of the key, or the dashboard role, lack the scope), secret_key_not_allowed (a secret key called an endpoint for the whole organization) or not_a_member (X-Fox-Tenant names a tenant the caller does not belong to).

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 404Not FoundError

    Not found

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject