Organization
Upsert Integration Key
Create or update an integration key for a provider
curl -X POST https://api.ugc.inc/org/integration-key/upsert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "openrouter",
"key": "sk-or-abc123..."
}'
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.org.upsertIntegrationKey({
provider: 'openrouter',
key: 'sk-or-abc123...'
});
if (response.ok) {
console.log('Key saved:', response.data.provider, response.data.maskedKey);
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "openrouter",
"maskedKey": "sk-o...8xYz",
"created_at": "2024-01-15T10:30:00.000Z"
}
}
⌘I
curl -X POST https://api.ugc.inc/org/integration-key/upsert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "openrouter",
"key": "sk-or-abc123..."
}'
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.org.upsertIntegrationKey({
provider: 'openrouter',
key: 'sk-or-abc123...'
});
if (response.ok) {
console.log('Key saved:', response.data.provider, response.data.maskedKey);
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "openrouter",
"maskedKey": "sk-o...8xYz",
"created_at": "2024-01-15T10:30:00.000Z"
}
}
