رفتن به محتوا
cloudhostمستندات
مرجع API

سکرت‌ها

پروژه‌های سکرت با محیط، نسخه و بازگشت، توکن پروژه، دسترسی، گزارش، مصرف و اتصال به فانکشن و برنامه.

توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته می‌شود. مسیرها، نام فیلدها و کدها همان‌اند که در درخواست می‌نویسید.
GET/v1/secrets/projects

List secrets projects#

The team's secrets projects (a restricted one only to those who may see it) and the plan's limits.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پاسخ

200object

  • projectsSecretProject[]الزامی
    • namestringالزامی
    • descriptionstring
    • environmentsstring[]الزامی
    • rotate_daysinteger | null
    • restrictedboolean
    • secretsinteger
    • tokensinteger
    • linksinteger
    • reads_30dinteger
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • accessstring

      what the caller may do with values

      one of none, read, write

  • limitsSecretLimits
    • projectsinteger
    • secretsinteger
    • perProjectinteger
    • secrets_usedinteger

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects" \
  -H "Authorization: Bearer $KEY"
POST/v1/secrets/projects

Create a secrets project#

Environments default to production, preview and development. restricted: true needs owner or admin.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

بدنهٔ درخواستapplication/json

  • namestringالزامی

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$

  • descriptionstring

    up to 300 characters

  • environmentsstring[]

    1–10 items

  • rotate_daysinteger | null

    1–3650

  • restrictedboolean

پاسخ

201SecretProjectCreated

  • namestringالزامی
  • descriptionstring
  • environmentsstring[]الزامی
  • rotate_daysinteger | null
  • restrictedboolean
  • secretsinteger
  • tokensinteger
  • linksinteger
  • reads_30dinteger
  • created_atstring (date-time)
  • updated_atstring (date-time)
  • accessstring

    what the caller may do with values

    one of none, read, write

خطاها

وضعیتتوضیح
400Bad request: bad_name, bad_environments, bad_days, bad_restricted
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: name_taken
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"STRIPE_KEY"}'
GET/v1/secrets/projects/{project}

Get a secrets project#

Settings and counts.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200SecretProject

  • namestringالزامی
  • descriptionstring
  • environmentsstring[]الزامی
  • rotate_daysinteger | null
  • restrictedboolean
  • secretsinteger
  • tokensinteger
  • linksinteger
  • reads_30dinteger
  • created_atstring (date-time)
  • updated_atstring (date-time)
  • accessstring

    what the caller may do with values

    one of none, read, write

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/secrets/projects/{project}

Delete a secrets project#

With its secrets, versions and tokens. Refused while a function or app links it (409 linked).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200object

  • deletedstring

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Conflict: linked
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/secrets/projects/{project}

Change a secrets project#

Any of description, rotate_days, restricted (owner or admin) and name (owner or admin). Environments change with the environments routes.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • descriptionstring

    up to 300 characters

  • rotate_daysinteger | null

    1–3650

  • restrictedboolean
  • namestring

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$

پاسخ

200SecretProject

  • namestringالزامی
  • descriptionstring
  • environmentsstring[]الزامی
  • rotate_daysinteger | null
  • restrictedboolean
  • secretsinteger
  • tokensinteger
  • linksinteger
  • reads_30dinteger
  • created_atstring (date-time)
  • updated_atstring (date-time)
  • accessstring

    what the caller may do with values

    one of none, read, write

خطاها

وضعیتتوضیح
400Bad request: nothing, use_environments, bad_name, bad_days, bad_restricted
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
409Conflict: name_taken
500internal: an unexpected failure

نمونه

curl -X PATCH "https://api.ibel.ai/v1/secrets/projects/shop" \
  -H "Authorization: Bearer $KEY" \
  -d '{"description":"…","rotate_days":1,"restricted":true,"name":"STRIPE_KEY"}'
POST/v1/secrets/projects/{project}/environments

Add an environment#

copy_from starts it with another environment's current values.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • namestringالزامی

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

  • copy_fromstring | null

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

201objectCreated

  • environmentsstring[]
  • copiedinteger

خطاها

وضعیتتوضیح
400Bad request: bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: exists
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/environments" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"STRIPE_KEY"}'
DELETE/v1/secrets/projects/{project}/environments/{env}

Remove an environment#

And its values. Refused for the last one, or while a live token reads it.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • envstringمسیرالزامی

    the environment

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200object

  • environmentsstring[]

خطاها

وضعیتتوضیح
400Bad request: bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Conflict: last_environment, in_use
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop/environments/production" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/projects/{project}/secrets

List secrets#

Also takes a project token (Bearer chsm_…). Names, types, versions per environment and rotation dates; never values. With values=1 and env, every value of that environment (SecretValues; needs step-up with a session).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
any role for names; values need developer or above (and access on a restricted project), or a project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • valuesstringکوئری

    1: the values of one environment

    one of 1, true

  • envstringکوئری

    the environment (default: the token's one environment, else development, else the project's first)

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200SecretList | SecretValues

  • projectstring
  • environmentsstring[]
  • secretsobject[]

خطاها

وضعیتتوضیح
400Bad request: bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found, no_environment
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/secrets" \
  -H "Authorization: Bearer $KEY"
POST/v1/secrets/projects/{project}/secrets

Set many secrets#

Also takes a project token (Bearer chsm_…). secrets (an object) or dotenv (the text of a .env file), up to 500, all or nothing.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • secretsmap of string
  • dotenvstring
  • environmentsstring[]

    1–10 items

  • typestring

    one of sensitive, plain

  • notestring

    up to 200 characters

پاسخ

201objectCreated

  • importedinteger
  • secretsSecretWritten[]
    • namestring
    • typestring
    • versionsmap of integer

خطاها

وضعیتتوضیح
400Bad request: bad_secrets, bad_name, bad_value, bad_environment, bad_type
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: stays_sensitive
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/secrets" \
  -H "Authorization: Bearer $KEY" \
  -d '{"secrets":{"KEY":"s3cr3t"},"dotenv":"…","environments":["…"],"type":"sensitive","note":"…"}'
GET/v1/secrets/projects/{project}/secrets/{name}

Read a secret#

Also takes a project token (Bearer chsm_…). One value; version for an older one; masked=1 answers with the mask only (no read counted, no step-up). A session needs step-up for the value.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
any role for names; values need developer or above (and access on a restricted project), or a project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

  • envstringکوئری

    the environment (default: the token's one environment, else development, else the project's first)

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

  • versionintegerکوئری

    an older version's number

    at least 1

  • maskedstringکوئری

    1: the mask only

    one of 1, true

پاسخ

200SecretValue

  • namestring
  • environmentstring
  • versioninteger
  • typestring
  • updated_atstring (date-time)
  • valuestring | null
  • maskedstring

    with masked=1: dots and the length, never a character of the value

خطاها

وضعیتتوضیح
400Bad request: bad_environment, bad_param
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found, no_environment
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PUT/v1/secrets/projects/{project}/secrets/{name}

Set a secret#

Also takes a project token (Bearer chsm_…). A new version in each environment named (default: all of the project's, or all the token reaches).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

بدنهٔ درخواستapplication/json

  • valuestringالزامی

    1–5120 characters

  • environmentsstring[]

    1–10 items

  • typestring

    one of sensitive, plain · default "sensitive"

  • descriptionstring

    up to 300 characters

  • rotate_daysinteger | null

    1–3650

  • notestring

    up to 200 characters

پاسخ

200SecretWritten

  • namestring
  • typestring
  • versionsmap of integer

خطاها

وضعیتتوضیح
400Bad request: bad_value, bad_environment, bad_environments, bad_type, bad_days
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: stays_sensitive
500internal: an unexpected failure

نمونه

curl -X PUT "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"value":"s3cr3t"}'
DELETE/v1/secrets/projects/{project}/secrets/{name}

Delete a secret#

Also takes a project token (Bearer chsm_…). With its history; env removes it from one environment only (as a version that says so).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

  • envstringکوئری

    remove it from this environment only

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200object

  • deletedstring
  • environmentstring

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/secrets/projects/{project}/secrets/{name}

Change a secret's settings#

Also takes a project token (Bearer chsm_…). Type (plain to sensitive only), description and rotate_days.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

بدنهٔ درخواستapplication/json

  • typestring

    one of sensitive, plain

  • descriptionstring

    up to 300 characters

  • rotate_daysinteger | null

    1–3650

پاسخ

200object

  • namestring
  • typestring
  • descriptionstring
  • rotate_daysinteger | null

خطاها

وضعیتتوضیح
400Bad request: bad_type, bad_days
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
409Conflict: stays_sensitive
500internal: an unexpected failure

نمونه

curl -X PATCH "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"type":"sensitive","description":"…","rotate_days":1}'
POST/v1/secrets/projects/{project}/secrets/{name}/rotate

Rotate a secret#

Also takes a project token (Bearer chsm_…). A new version with the value given, or a random one (length, default 40) returned once as value. Clears the rotation reminder.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

بدنهٔ درخواستapplication/json

  • valuestring

    up to 5120 characters

  • lengthinteger

    16–512

  • environmentsstring[]

    1–10 items

  • notestring

    up to 200 characters

پاسخ

200SecretWritten

  • namestring
  • typestring
  • versionsmap of integer
  • valuestring

    the generated value, shown once

خطاها

وضعیتتوضیح
400Bad request: bad_value, bad_length, bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required, limit
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY/rotate" \
  -H "Authorization: Bearer $KEY" \
  -d '{"value":"s3cr3t","length":16,"environments":["…"],"note":"…"}'
GET/v1/secrets/projects/{project}/secrets/{name}/versions

A secret's versions#

Also takes a project token (Bearer chsm_…). Every kept version, newest first; env for one environment. Never values.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
any role for names; values need developer or above (and access on a restricted project), or a project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

  • envstringکوئری

    one environment

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200object

  • namestring
  • versionsSecretVersion[]
    • environmentstring
    • versioninteger
    • kindstring

      one of set, import, rotate, rollback, delete

    • notestring
    • currentboolean
    • created_atstring (date-time)
    • created_byobject | null

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY/versions" \
  -H "Authorization: Bearer $KEY"
POST/v1/secrets/projects/{project}/secrets/{name}/rollback

Roll a secret back#

Also takes a project token (Bearer chsm_…). Version to's value becomes a new current version in env.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (write access on a restricted project), or a write project token
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • namestringمسیرالزامی

    the secret's name

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$ · up to 64 characters

بدنهٔ درخواستapplication/json

  • envstring

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

  • tointegerالزامی

    at least 1

پاسخ

200SecretWritten

  • namestring
  • typestring
  • versionsmap of integer
  • rolled_back_tointeger

خطاها

وضعیتتوضیح
400Bad request: bad_version, bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/secrets/STRIPE_KEY/rollback" \
  -H "Authorization: Bearer $KEY" \
  -d '{"to":1}'
GET/v1/secrets/projects/{project}/export

Every value of one environment#

Also takes a project token (Bearer chsm_…). For run -- and programs (a session needs step-up). plain=1 leaves sensitive values out and names them in withheld (what secrets pull uses). format=dotenv answers text/plain NAME="value" lines.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
any role for names; values need developer or above (and access on a restricted project), or a project token

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • envstringکوئری

    the environment (default: the token's one environment, else development, else the project's first)

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

  • plainstringکوئری

    1: sensitive values left out

    one of 1, true

  • formatstringکوئری

    dotenv: text instead of JSON

    one of dotenv

پاسخ

200SecretExport

  • projectstring
  • environmentstring
  • valuesmap of string
  • withheldstring[]

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found, no_environment
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/export" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/projects/{project}/tokens

List a project's tokens#

Live, expired and revoked; never the secret.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200object

  • tokensSecretToken[]
    • idstring
    • namestring
    • accessstring

      one of read, write

    • environmentsstring[] | null
    • expires_atstring (date-time) | null
    • last_used_atstring (date-time) | null
    • created_atstring (date-time)
    • created_byobject | null
    • revoked_atstring (date-time) | null
    • statestring

      one of active, expired, revoked

  • limitinteger

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/tokens" \
  -H "Authorization: Bearer $KEY"
POST/v1/secrets/projects/{project}/tokens

Make a project token#

Read or write, all or some environments, optional expiry; never more than its maker reaches. The token is shown once.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (with that access to each environment)
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • namestring

    up to 80 characters

  • accessstring

    one of read, write · default "read"

  • environmentsstring[]

    1–10 items

  • expires_in_daysinteger | null

    1–3650

پاسخ

201SecretTokenCreated

  • idstring
  • namestring
  • accessstring

    one of read, write

  • environmentsstring[] | null
  • expires_atstring (date-time) | null
  • last_used_atstring (date-time) | null
  • created_atstring (date-time)
  • created_byobject | null
  • revoked_atstring (date-time) | null
  • statestring

    one of active, expired, revoked

  • tokenstring

    chsm_<id>_<secret>, shown once

خطاها

وضعیتتوضیح
400Bad request: bad_access, bad_environment, bad_environments, bad_days
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required, limit
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/tokens" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"STRIPE_KEY","access":"read","environments":["…"],"expires_in_days":1}'
DELETE/v1/secrets/projects/{project}/tokens/{id}

Revoke a project token#

At once on this API process, within 15 seconds on the others.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstringمسیرالزامی

    the token's id

    pattern ^[0-9a-f]{12}$

پاسخ

200object

  • revokedstring

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop/tokens/3f9a1c2b7d4e" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/projects/{project}/access

Who reaches a project#

Every member with their role, their listing on a restricted project and what they may do; and the live tokens.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200object

  • restrictedboolean
  • peopleSecretAccessPerson[]
  • tokensSecretToken[]

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/access" \
  -H "Authorization: Bearer $KEY"
PUT/v1/secrets/projects/{project}/access/{person}

List a member on a project#

Read or write access on a restricted project.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • personstring (uuid)مسیرالزامی

    the member's id

بدنهٔ درخواستapplication/json

  • accessstringالزامی

    one of read, write

پاسخ

200object

  • personstring
  • emailstring
  • accessstring

خطاها

وضعیتتوضیح
400Bad request: bad_access
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X PUT "https://api.ibel.ai/v1/secrets/projects/shop/access/5b0f4c2e-8f1d-4a7e-9c3b-2d6e1f0a9b8c" \
  -H "Authorization: Bearer $KEY" \
  -d '{"access":"read"}'
DELETE/v1/secrets/projects/{project}/access/{person}

Unlist a member#

Takes the person off a project's list.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • personstring (uuid)مسیرالزامی

    the member's id

پاسخ

200object

  • removedstring

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop/access/5b0f4c2e-8f1d-4a7e-9c3b-2d6e1f0a9b8c" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/projects/{project}/audit

A project's audit trail#

Every read, change, rotation, rollback, pull, export, token, access change and link; never a value. Identical reads in one minute are one event with a count.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • limitintegerکوئری

    events per page

    1–500 · default 100

  • beforestringکوئری

    the next of the last page

    pattern ^\d{1,18}$

  • actionstringکوئری

    one action (or its family, e.g. token)

  • secretstringکوئری

    one secret

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$

  • envstringکوئری

    one environment

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200SecretAudit

  • eventsobject[]
    • idstring
    • atstring (date-time)
    • projectstring
    • actionstring
    • secretstring | null
    • environmentstring | null
    • versioninteger | null
    • actorobject | null
    • ipstring | null
    • countinteger
  • nextstring | null

خطاها

وضعیتتوضیح
400Bad request: bad_param, bad_name, bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/audit

The team's secrets audit trail#

As a project's, across every project.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین

پارامترها

  • limitintegerکوئری

    events per page

    1–500 · default 100

  • beforestringکوئری

    the next of the last page

    pattern ^\d{1,18}$

  • actionstringکوئری

    one action (or its family)

  • secretstringکوئری

    one secret

    pattern ^[A-Za-z_][A-Za-z0-9_]{0,63}$

  • envstringکوئری

    one environment

    pattern ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$

پاسخ

200SecretAudit

  • eventsobject[]
    • idstring
    • atstring (date-time)
    • projectstring
    • actionstring
    • secretstring | null
    • environmentstring | null
    • versioninteger | null
    • actorobject | null
    • ipstring | null
    • countinteger
  • nextstring | null

خطاها

وضعیتتوضیح
400Bad request: bad_param, bad_name, bad_environment
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/projects/{project}/usage

A project's usage#

Reads and writes per day and this month, and secrets stored.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • daysintegerکوئری

    days back

    1–90 · default 30

پاسخ

200SecretUsage

  • projectstring
  • daysobject[]
  • monthobject
  • secrets_storedinteger

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/projects/shop/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/usage

The team's secrets usage#

As a project's, for the whole team, with the plan and its included amounts. Meters: secrets_stored and secret_reads (prices in GET /v1/pricing); writes are counted, not priced.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • daysintegerکوئری

    days back

    1–90 · default 30

پاسخ

200SecretUsage

  • daysobject[]
  • monthobject
  • secrets_storedinteger
  • planstring
  • includedobject

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/usage" \
  -H "Authorization: Bearer $KEY"
POST/v1/secrets/projects/{project}/links

Link a function or app#

It reads the project with no network call: binding mode gives env.SECRETS.get("NAME") and env.SECRETS.list(); variables gives each secret as env.NAME (a project or team variable of the same name wins). Production deployments get the production values, previews the preview values. One project per function or app.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
owner, admin, developer (with read access to production and preview)

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • projectstringالزامی

    the function's or app's name

  • modestring

    one of binding, variables · default "binding"

  • bindingstring

    pattern ^[A-Z_][A-Z0-9_]{0,63}$ · default "SECRETS"

پاسخ

201SecretLinkCreated

  • projectstring
  • kindstring
  • secrets_projectstring
  • modestring

    one of binding, variables

  • bindingstring | null
  • created_atstring (date-time)

خطاها

وضعیتتوضیح
400Bad request: bad_project, bad_mode, bad_binding
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
409Conflict: linked
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/secrets/projects/shop/links" \
  -H "Authorization: Bearer $KEY" \
  -d '{"project":"shop"}'
DELETE/v1/secrets/projects/{project}/links/{function}

Unlink a function or app#

It stops reading the project at once.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • projectstringمسیرالزامی

    the secrets project's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • functionstringمسیرالزامی

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$

پاسخ

200object

  • unlinkedstring

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/secrets/projects/shop/links/function" \
  -H "Authorization: Bearer $KEY"
GET/v1/secrets/links

The links of a function or app#

Which secrets project it reads (the environment variables page).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • projectstringکوئری

    the function's or app's name

پاسخ

200object

  • linksSecretLink[]
    • projectstring
    • kindstring
    • secrets_projectstring
    • modestring

      one of binding, variables

    • bindingstring | null
    • created_atstring (date-time)

خطاها

وضعیتتوضیح
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/secrets/links" \
  -H "Authorization: Bearer $KEY"