Secrets service#
The secrets service provides functionality for creating and retrieving customer secrets (e.g. influx passwords, API keys, etc)
OpenAPI file: SecretService.json
Endpoints#
Create#
POST /secrets/v1/secrets
Create a new secret.
Body
namestring required
descriptionstring required
decryptedValuestring required
propertiesmap ofPropertyNameto string
labelsarray of string
workspacestring (RID)The workspace in which to create the secret. If not provided, the secret will be created in the default workspace for the user’s organization, if the default workspace for the organization is configured.
Response
ridstring (RID)
namestring
descriptionstring
createdBystring (RID)
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time)
isArchivedboolean
Request
curl -X POST "https://api.gov.nominal.io/api/secrets/v1/secrets" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"name": "<name>",
"description": "<description>",
"decryptedValue": "<decrypted value>"
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"decryptedValue": "<decrypted value>",
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"decryptedValue": "<decrypted value>",
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"decryptedValue": "<decrypted value>",
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"rid": "<secret rid>",
"name": "<name>",
"description": "<description>",
"createdBy": "<created by>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"createdAt": "2026-01-01T00:00:00Z",
"isArchived": true
}
Get#
GET /secrets/v1/secrets/{rid}
Get secret by rid.
Path parameters
ridstring (RID) required
Response
ridstring (RID)
namestring
descriptionstring
createdBystring (RID)
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time)
isArchivedboolean
Request
curl "https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>" \
-H "Authorization: Bearer <api key>"
import requests
response = requests.get(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.get(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.get(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"rid": "<secret rid>",
"name": "<name>",
"description": "<description>",
"createdBy": "<created by>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"createdAt": "2026-01-01T00:00:00Z",
"isArchived": true
}
Update#
PUT /secrets/v1/secrets/{rid}
Update a secret by rid.
Path parameters
ridstring (RID) required
Body
namestring
descriptionstring
propertiesmap ofPropertyNameto string
labelsarray of string
decryptedValuestring
Response
ridstring (RID)
namestring
descriptionstring
createdBystring (RID)
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time)
isArchivedboolean
Request
curl -X PUT "https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"name": "<name>",
"description": "<description>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"decryptedValue": "<decrypted value>"
}'
import requests
response = requests.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"properties": {"<key>": "<property value>"},
"labels": ["<label>"],
"decryptedValue": "<decrypted value>",
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"properties": {"<key>": "<property value>"},
"labels": ["<label>"],
"decryptedValue": "<decrypted value>",
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
json={
"name": "<name>",
"description": "<description>",
"properties": {"<key>": "<property value>"},
"labels": ["<label>"],
"decryptedValue": "<decrypted value>",
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"rid": "<secret rid>",
"name": "<name>",
"description": "<description>",
"createdBy": "<created by>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"createdAt": "2026-01-01T00:00:00Z",
"isArchived": true
}
Delete#
DELETE /secrets/v1/secrets/{rid}
Delete a secret by rid. This is a permanent deletion. To perform a soft delete, use the archive endpoint.
Path parameters
ridstring (RID) required
Response
No content (HTTP 204).
Request
curl -X DELETE "https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>" \
-H "Authorization: Bearer <api key>"
import requests
response = requests.delete(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import httpx
response = httpx.delete(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.delete(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>",
headers={"Authorization": "Bearer <api key>"},
) as response:
response.raise_for_status()
asyncio.run(main())
Response: 204
No content.
Get batch#
POST /secrets/v1/secrets/batch
Get secrets by a set of rids.
Body
secretRidsarray of string (RID)
Response
responsearray ofSecret
Fields of
Secretridstring (RID)
namestring
descriptionstring
createdBystring (RID)
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time)
isArchivedboolean
Request
curl -X POST "https://api.gov.nominal.io/api/secrets/v1/secrets/batch" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"secretRids": [
"<secret rid>"
]
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/batch",
headers={"Authorization": "Bearer <api key>"},
json={"secretRids": ["<secret rid>"]},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/batch",
headers={"Authorization": "Bearer <api key>"},
json={"secretRids": ["<secret rid>"]},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/batch",
headers={"Authorization": "Bearer <api key>"},
json={"secretRids": ["<secret rid>"]},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"response": [
{
"rid": "<secret rid>",
"name": "<name>",
"description": "<description>",
"createdBy": "<created by>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"createdAt": "2026-01-01T00:00:00Z",
"isArchived": true
}
]
}
Archive#
PUT /secrets/v1/secrets/{rid}/archive
Archive a secret by rid.
Path parameters
ridstring (RID) required
Response
No content (HTTP 204).
Request
curl -X PUT "https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/archive" \
-H "Authorization: Bearer <api key>"
import requests
response = requests.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/archive",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import httpx
response = httpx.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/archive",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/archive",
headers={"Authorization": "Bearer <api key>"},
) as response:
response.raise_for_status()
asyncio.run(main())
Response: 204
No content.
Unarchive#
PUT /secrets/v1/secrets/{rid}/unarchive
Unarchive a secret by rid.
Path parameters
ridstring (RID) required
Response
No content (HTTP 204).
Request
curl -X PUT "https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/unarchive" \
-H "Authorization: Bearer <api key>"
import requests
response = requests.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/unarchive",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import httpx
response = httpx.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/unarchive",
headers={"Authorization": "Bearer <api key>"},
)
response.raise_for_status()
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.put(
"https://api.gov.nominal.io/api/secrets/v1/secrets/<rid>/unarchive",
headers={"Authorization": "Bearer <api key>"},
) as response:
response.raise_for_status()
asyncio.run(main())
Response: 204
No content.
Search#
POST /secrets/v1/secrets/search
Returns metadata about secrets that match a given query.
Body
querySearchSecretsQueryrequired
Set
typeto"searchText".searchTextstring
Set
typeto"label".labelstring
Set
typeto"property".propertyProperty
Fields of
Propertynamestring required
valuestring required
Set
typeto"and".andarray ofSearchSecretsQuery
Set
typeto"or".orarray ofSearchSecretsQuery
Set
typeto"workspace".workspacestring (RID)
pageSizeintegerDefaults to 100. Will throw if larger than 1000.
sortSortOptionsrequired
Fields of
SortOptionsisDescendingboolean required
fieldSortFieldrequired
Values of
SortFieldCREATED_AT
tokenstring
archivedStatusesarray ofArchivedStatusDefault search status is NOT_ARCHIVED if none are provided. Allows for including archived secrets in search.
Values of
ArchivedStatusNOT_ARCHIVED
ARCHIVED
Response
resultsarray ofSecret
Fields of
Secretridstring (RID)
namestring
descriptionstring
createdBystring (RID)
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time)
isArchivedboolean
nextPageTokenstring
Request
curl -X POST "https://api.gov.nominal.io/api/secrets/v1/secrets/search" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"query": {
"type": "searchText",
"searchText": "<search text>"
},
"sort": {
"isDescending": true,
"field": "CREATED_AT"
}
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/search",
headers={"Authorization": "Bearer <api key>"},
json={
"query": {"type": "searchText", "searchText": "<search text>"},
"sort": {"isDescending": True, "field": "CREATED_AT"},
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/search",
headers={"Authorization": "Bearer <api key>"},
json={
"query": {"type": "searchText", "searchText": "<search text>"},
"sort": {"isDescending": True, "field": "CREATED_AT"},
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/secrets/v1/secrets/search",
headers={"Authorization": "Bearer <api key>"},
json={
"query": {"type": "searchText", "searchText": "<search text>"},
"sort": {"isDescending": True, "field": "CREATED_AT"},
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"results": [
{
"rid": "<secret rid>",
"name": "<name>",
"description": "<description>",
"createdBy": "<created by>",
"properties": {
"<key>": "<property value>"
},
"labels": [
"<label>"
],
"createdAt": "2026-01-01T00:00:00Z",
"isArchived": true
}
],
"nextPageToken": "<token>"
}
Errors#
Errors shows how these errors are sent.
Each error’s errorName is Secrets: followed by its name below.
Status |
Name |
Notes |
|---|---|---|
404 |
|
|
404 |
|
|
500 |
|
Types#
ArchivedStatus#
NOT_ARCHIVED
ARCHIVED
Property#
namestring required
valuestring required
SearchSecretsQuery#
Set type to the name of one of the other fields, and set only that field.
searchTextstring
labelstring
propertyProperty
andarray ofSearchSecretsQuery
orarray ofSearchSecretsQuery
workspacestring (RID)
Secret#
ridstring (RID) required
namestring required
descriptionstring required
createdBystring (RID) required
propertiesmap ofPropertyNameto string
labelsarray of string
createdAtstring (date-time) required
isArchivedboolean required
SortField#
CREATED_AT
SortOptions#
isDescendingboolean required
fieldSortFieldrequired
Page design based on Scalar, MIT License.