Update API key
curl --request PUT \
--url https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production API Key",
"description": "Used for production server",
"scopes": [
"read:user",
"write:webhooks"
],
"rateLimitPerMinute": 60,
"rateLimitPerHour": 1000,
"allowedIps": [
"192.168.1.1",
"10.0.0.0/24"
],
"expiresAt": "2025-12-31T23:59:59Z"
}
'import requests
url = "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}"
payload = {
"name": "Production API Key",
"description": "Used for production server",
"scopes": ["read:user", "write:webhooks"],
"rateLimitPerMinute": 60,
"rateLimitPerHour": 1000,
"allowedIps": ["192.168.1.1", "10.0.0.0/24"],
"expiresAt": "2025-12-31T23:59:59Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production API Key',
description: 'Used for production server',
scopes: ['read:user', 'write:webhooks'],
rateLimitPerMinute: 60,
rateLimitPerHour: 1000,
allowedIps: ['192.168.1.1', '10.0.0.0/24'],
expiresAt: '2025-12-31T23:59:59Z'
})
};
fetch('https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production API Key',
'description' => 'Used for production server',
'scopes' => [
'read:user',
'write:webhooks'
],
'rateLimitPerMinute' => 60,
'rateLimitPerHour' => 1000,
'allowedIps' => [
'192.168.1.1',
'10.0.0.0/24'
],
'expiresAt' => '2025-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_bodyAPI Keys
Update API Key
Update API key settings (name, scopes, rate limits, etc.)
PUT
/
organizations
/
{organizationId}
/
api-keys
/
{id}
Update API key
curl --request PUT \
--url https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production API Key",
"description": "Used for production server",
"scopes": [
"read:user",
"write:webhooks"
],
"rateLimitPerMinute": 60,
"rateLimitPerHour": 1000,
"allowedIps": [
"192.168.1.1",
"10.0.0.0/24"
],
"expiresAt": "2025-12-31T23:59:59Z"
}
'import requests
url = "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}"
payload = {
"name": "Production API Key",
"description": "Used for production server",
"scopes": ["read:user", "write:webhooks"],
"rateLimitPerMinute": 60,
"rateLimitPerHour": 1000,
"allowedIps": ["192.168.1.1", "10.0.0.0/24"],
"expiresAt": "2025-12-31T23:59:59Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production API Key',
description: 'Used for production server',
scopes: ['read:user', 'write:webhooks'],
rateLimitPerMinute: 60,
rateLimitPerHour: 1000,
allowedIps: ['192.168.1.1', '10.0.0.0/24'],
expiresAt: '2025-12-31T23:59:59Z'
})
};
fetch('https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production API Key',
'description' => 'Used for production server',
'scopes' => [
'read:user',
'write:webhooks'
],
'rateLimitPerMinute' => 60,
'rateLimitPerHour' => 1000,
'allowedIps' => [
'192.168.1.1',
'10.0.0.0/24'
],
'expiresAt' => '2025-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production API Key\",\n \"description\": \"Used for production server\",\n \"scopes\": [\n \"read:user\",\n \"write:webhooks\"\n ],\n \"rateLimitPerMinute\": 60,\n \"rateLimitPerHour\": 1000,\n \"allowedIps\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_bodyUpdates an API key’s settings.
Permissions
User must be owner or admin.What Can Be Updated
- Name and description
- Scopes (permissions)
- Rate limits (per minute/hour)
- Allowed IP addresses
- Expiration date
Example
curl -X PUT https://api.timbrix.mx/organizations/{organizationId}/api-keys/{id} \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated API Key Name",
"scopes": ["read:user", "write:webhooks"]
}'
Security Considerations
- Changing scopes immediately affects API access
- Rate limit changes take effect on next request
- IP restrictions are enforced in real-time
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
API key name
Required string length:
3 - 50Example:
"Production API Key"
API key description
Maximum string length:
200Example:
"Used for production server"
API key scopes (permissions). Defaults to ['read:user'] if not provided
Available options:
read:user, write:user, read:organization, write:organization, read:members, write:members, read:webhooks, write:webhooks, read:api-keys, write:api-keys, read:invoices, write:invoices Example:
["read:user", "write:webhooks"]
Rate limit per minute
Required range:
1 <= x <= 10000Example:
60
Rate limit per hour
Required range:
1 <= x <= 100000Example:
1000
Allowed IP addresses (CIDR notation supported)
Example:
["192.168.1.1", "10.0.0.0/24"]
Expiration date
Example:
"2025-12-31T23:59:59Z"
Response
API key updated successfully
⌘I