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",
"creator_access": true
}
'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',
creator_access: true
})
};
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",
"creator_access": True
}
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",
"creator_access": false
},
"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",
"creator_access": true
}
'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',
creator_access: true
})
};
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",
"creator_access": True
}
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",
"creator_access": false
},
"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
Body
application/json
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, imports.write, exports.read, suppressions.write, audiences.delete, topics.delete, templates.write, templates.publish, templates.delete, templates.test.send, campaigns.deliver, campaigns.delete, automations.publish, automations.delete, domains.write, domains.delete, push_apps.delete, push_channels.delete, push_providers.write, push_channels.write, account.read, personal_keys.manage, account.write, teams.create, team.read, team.settings.write, projects.write, team.members.write, team.access.write, integration_keys.write, team.ownership.transfer, team.delete