Connected clients
Create a scoped REST credential (secret shown once)
One credential for one client that cannot use OAuth, usable on the phone routes only.
POST
/
v1
/
client-grants
/
rest
Create a scoped REST credential (secret shown once)
curl --request POST \
--url https://api.sempera.org/v1/client-grants/rest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client": "muse",
"scopes": []
}
'import requests
url = "https://api.sempera.org/v1/client-grants/rest"
payload = {
"client": "muse",
"scopes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client: 'muse', scopes: []})
};
fetch('https://api.sempera.org/v1/client-grants/rest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "client_grant",
"kind": "oauth",
"client": "<string>",
"label": "<string>",
"verified": true,
"redirect_host": "<string>",
"scopes": [
"<string>"
],
"status": "active",
"workspace_id": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"last_used_at": "<string>",
"revoked_at": "<string>",
"secret": "<string>",
"note": "<string>"
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}Authorizations
A workspace API key, sent as Authorization: Bearer sempera_sk_... Each operation names the one scope it needs. Scopes, key kinds and roles are in the Authentication guide.
Body
application/json
Response
Created
Available options:
oauth, bearer, rest Available options:
active, revoked, expired Shown once, only on creation.
⌘I
Create a scoped REST credential (secret shown once)
curl --request POST \
--url https://api.sempera.org/v1/client-grants/rest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client": "muse",
"scopes": []
}
'import requests
url = "https://api.sempera.org/v1/client-grants/rest"
payload = {
"client": "muse",
"scopes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client: 'muse', scopes: []})
};
fetch('https://api.sempera.org/v1/client-grants/rest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "client_grant",
"kind": "oauth",
"client": "<string>",
"label": "<string>",
"verified": true,
"redirect_host": "<string>",
"scopes": [
"<string>"
],
"status": "active",
"workspace_id": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"last_used_at": "<string>",
"revoked_at": "<string>",
"secret": "<string>",
"note": "<string>"
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}