Replace personal scopes/grants or update key metadata
curl --request PATCH \
--url https://w-api.sendrealm.com/v1/users/me/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_grant_version": 1,
"name": "<string>",
"current_password": "<string>",
"scopes": [],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"select_all_current_teams": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_grant_version: 1,
name: '<string>',
current_password: '<string>',
scopes: [],
grants: [
{
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
select_all_current_teams: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://w-api.sendrealm.com/v1/users/me/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://w-api.sendrealm.com/v1/users/me/api-keys/{id}"
payload = {
"expected_grant_version": 1,
"name": "<string>",
"current_password": "<string>",
"scopes": [],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"select_all_current_teams": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preview": "<string>",
"scopes": [
"resources.read"
],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"membership_active": true,
"team_name": "<string>",
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
],
"grant_version": 123,
"grants_initialized_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"status": 123,
"metadata": {
"total": 123,
"items": 123,
"limit": 123,
"after": "<string>",
"next": "<string>",
"has_more": true
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}Personal Key Management
Edit Personal API Key
Edit active key metadata, operation scopes, or grant snapshots with version checking.
PATCH
/
v1
/
users
/
me
/
api-keys
/
{id}
Replace personal scopes/grants or update key metadata
curl --request PATCH \
--url https://w-api.sendrealm.com/v1/users/me/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_grant_version": 1,
"name": "<string>",
"current_password": "<string>",
"scopes": [],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"select_all_current_teams": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_grant_version: 1,
name: '<string>',
current_password: '<string>',
scopes: [],
grants: [
{
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
select_all_current_teams: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://w-api.sendrealm.com/v1/users/me/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://w-api.sendrealm.com/v1/users/me/api-keys/{id}"
payload = {
"expected_grant_version": 1,
"name": "<string>",
"current_password": "<string>",
"scopes": [],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"select_all_current_teams": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preview": "<string>",
"scopes": [
"resources.read"
],
"grants": [
{
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"membership_active": true,
"team_name": "<string>",
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
],
"grant_version": 123,
"grants_initialized_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"status": 123,
"metadata": {
"total": 123,
"items": 123,
"limit": 123,
"after": "<string>",
"next": "<string>",
"has_more": true
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}The signed-in owner must supply
expected_grant_version. Widening scopes/projects, rebinding changed memberships, or extending expiration requires current-password confirmation. Narrowing access does not. A concurrent edit requires refreshing and reviewing the saved record; expired or revoked keys cannot be reactivated.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Optimistic concurrency token from the latest management record. Re-read after 409.
Required range:
x >= 0Required string length:
1 - 120Required when widening grants/scopes, rebinding memberships or extending expiry. Never logged.
Explicit current MCP operation. All scopes is this saved list; future operations require an owner edit.
Available options:
resources.read, diagnostics.read, audiences.write, topics.write, campaigns.draft.write, automations.draft.write, automation_tests.write, automation_runs.manage, push_apps.write, push.test.send, events.ingest, automations.trigger Show child attributes
Show child attributes
Resolve the owner's current eligible projects at submission and save their IDs; future access is excluded.