秘
Env variables API
3 operationsjobs:writejobs:read
Secrets and settings your script jobs read. Stored encrypted, bound to a job by name, never returned and hidden in script output.
| DELETE | /env/{name} | Delete an env variable. |
| PUT | /env/{name} | Set an env variable that script and browser jobs can bind. The value is stored encrypted and never returned. |
| GET | /env | List the names of the account's env variables. |
Delete an env variable.
DELETE
/v1/env/{name}scope jobs:write
Parameters
namestring · path required |
Response
1 fields
status | boolean |
curl -X DELETE "https://api.hoshime.com/v1/env/{name}" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/env/{name}", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.delete( "https://api.hoshime.com/v1/env/{name}", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "status": false }
Set an env variable that script and browser jobs can bind. The value is stored encrypted and never returned.
PUT
/v1/env/{name}scope jobs:write
Parameters
namestring · path required |
Request body
valuestring required |
Response
3 fields
createdAt | integer (int64) |
name | string |
updatedAt | integer (int64) |
curl -X PUT "https://api.hoshime.com/v1/env/{name}" \ -H "Authorization: Bearer $HOSHIME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "value": "…" }'
const res = await fetch("https://api.hoshime.com/v1/env/{name}", { method: "PUT", headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({ "value": "…" }), }); const { data, meta } = await res.json();
import os, requests res = requests.put( "https://api.hoshime.com/v1/env/{name}", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, json={ "value": "…" }, ) body = res.json()
{ "createdAt": 0, "name": "…", "updatedAt": 0 }
List the names of the account's env variables.
GET
/v1/envscope jobs:read
Parameters
pageinteger | |
limitinteger | |
withTotalboolean |
Response
8 fields
pageOptions | PageResult | null |
hasNext | boolean |
page | integer (int32) |
total | integer (int64) |
results | EnvVar[] |
createdAt | integer (int64) |
name | string |
updatedAt | integer (int64) |
curl "https://api.hoshime.com/v1/env" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/env", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/env", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "pageOptions": { "hasNext": false, "page": 0, "total": 0 }, "results": [ { "createdAt": 0, "name": "…", "updatedAt": 0 } ] }