Die Suche lädt erst bei Nutzung. Durchsuche unten alle Kategorien.

Konten und Workspaces

API-Schlüssel erneuern

Erstelle einen Nachfolger für einen API-Schlüssel (id) mit einmalig zurückgegebenem neuem Geheimnis und denselben Funktionen und Workspace-Grenzen; optional mit neuem Namen oder Laufzeit (höchstens 365 Tage, 30 für agentenerstellte Schlüssel). Der ursprüngliche Schlüssel wird nicht widerrufen. Erfordert „API-Schlüssel verwalten“.

POST /identity-api/api-keys/renew

Vertrag geprüft: · sha256:563d2d581da0ad29

Überblick

Erstelle einen Nachfolger für einen API-Schlüssel (id) mit einmalig zurückgegebenem neuem Geheimnis und denselben Funktionen und Workspace-Grenzen; optional mit neuem Namen oder Laufzeit (höchstens 365 Tage, 30 für agentenerstellte Schlüssel). Der ursprüngliche Schlüssel wird nicht widerrufen. Erfordert „API-Schlüssel verwalten“.

Eine erfolgreiche HTTP-Antwort kann Annahme statt Abschluss bedeuten. Speichere bei Hintergrundarbeit die ID und prüfe dieselbe Operation bis zum Abschluss. Geplante oder angenommene Beiträge gelten erst nach Plattformbestätigung als veröffentlicht; ein Client-Timeout klärt das Ergebnis nicht.

Authentifizierung und Berechtigungen

Akzeptierte Zugangsdatenklassen
user_session, delegated_oauth
Delegierte Funktion
agent:manage_api_keys
Minimale Workspace-Rolle
Dieser Vertrag schreibt keine minimale Workspace-Rolle vor; Eigentums- und Berechtigungsprüfungen gelten weiterhin.
Zugriffsumfang
Kontobezogene Befugnisse
Zustimmung für alle Workspaces erforderlich
Ja
Ändert Zustand
Ja
Nach Abschluss der Operation
synchronous_http_response

Ein Token nutzt nur Eigentümerrechte. Jede Anfrage prüft Workspace-Mitgliedschaft, Ressourceneigentum, gewählte Workspaces und Funktionen. core und full ändern sichtbare Tools; sie erteilen keinen Zugriff.

Anfragefelder

Erforderlich bedeutet innerhalb des übergeordneten Objekts und gewählten Zweigs erforderlich. Ein erforderliches Kind macht kein optionales Elternobjekt erforderlich. Regeln und Feldnamen unten stammen aus dem Vertrag.

Anfragefelder
Feld / VarianteTyp / erforderlichEinschränkungen
$objectIm Elternobjekt erforderlich
  • additionalProperties: false
idstringIm Elternobjekt erforderlich
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
namestringOptional / Element
  • minLength: 1
  • maxLength: 80
lifetime_daysintegerOptional / Element

Tage bis Ablauf des Nachfolgers (1-365, Standard 365; höchstens 30 für delegiert-agentenerstellte Schlüssel). Der Nachfolger behält Funktionen und Workspace-Grenze des Vorgängers.

  • minimum: 1
  • maximum: 365
  • default: 365
idempotency_keystringOptional / Element

Optional. Nutze denselben Schlüssel für sichere Wiederholung. Das neue Geheimnis wird einmal angezeigt: Eine Wiederholung mit bereits erstelltem Nachfolger liefert 409 IDEMPOTENT_REPLAY (details.existing_key benennt ihn). Widerrufe ihn und erneuere mit neuem idempotency_key erneut.

  • minLength: 8
  • maxLength: 160
  • pattern: "^[!-~]+$"
Vollständiges JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "lifetime_days": {
      "default": 365,
      "description": "Days until the successor expires (1-365, default 365; 30 at most for a key created by a delegated agent). The successor keeps the predecessor's capabilities and Workspace limit.",
      "type": "integer",
      "minimum": 1,
      "maximum": 365
    },
    "idempotency_key": {
      "description": "Optional. Reuse the same key to retry safely. The new secret is shown once: a retry that finds the successor already created answers 409 IDEMPOTENT_REPLAY (details.existing_key names it). Revoke it and renew again with a new idempotency_key.",
      "type": "string",
      "minLength": 8,
      "maxLength": 160,
      "pattern": "^[!-~]+$"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}

Antwort und Abschluss

HTTP-Erfolgsstatus: 201. Nach Abschluss der Operation: synchronous_http_response.

Eine erfolgreiche HTTP-Antwort kann Annahme statt Abschluss bedeuten. Speichere bei Hintergrundarbeit die ID und prüfe dieselbe Operation bis zum Abschluss. Geplante oder angenommene Beiträge gelten erst nach Plattformbestätigung als veröffentlicht; ein Client-Timeout klärt das Ergebnis nicht.

Erforderlich bedeutet innerhalb des übergeordneten Objekts und gewählten Zweigs erforderlich. Ein erforderliches Kind macht kein optionales Elternobjekt erforderlich. Regeln und Feldnamen unten stammen aus dem Vertrag.

Antwort und Abschluss
Feld / VarianteTyp / erforderlichEinschränkungen
$objectIm Elternobjekt erforderlich—
apiKeyobjectIm Elternobjekt erforderlich—
apiKey.idstringIm Elternobjekt erforderlich
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
apiKey.namestringIm Elternobjekt erforderlich—
apiKey.last_4stringIm Elternobjekt erforderlich—
apiKey.scopesarrayIm Elternobjekt erforderlich—
apiKey.scopes[]stringOptional / Element—
apiKey.created_atstringIm Elternobjekt erforderlich
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
apiKey.expires_atstring | nullIm Elternobjekt erforderlich—
apiKey.expires_atanyOf 1stringIm Elternobjekt erforderlich
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
apiKey.expires_atanyOf 2nullIm Elternobjekt erforderlich—
apiKey.last_used_atstring | nullIm Elternobjekt erforderlich—
apiKey.last_used_atanyOf 1stringIm Elternobjekt erforderlich
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
apiKey.last_used_atanyOf 2nullIm Elternobjekt erforderlich—
apiKey.revoked_atstring | nullIm Elternobjekt erforderlich—
apiKey.revoked_atanyOf 1stringIm Elternobjekt erforderlich
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
apiKey.revoked_atanyOf 2nullIm Elternobjekt erforderlich—
apiKey.statusstringIm Elternobjekt erforderlich
  • enum: ["active","expired","revoked"]
apiKey.replacesobject | nullIm Elternobjekt erforderlich—
apiKey.replacesanyOf 1objectIm Elternobjekt erforderlich—
apiKey.replaces.idanyOf 1stringIm Elternobjekt erforderlich
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
apiKey.replaces.nameanyOf 1stringIm Elternobjekt erforderlich—
apiKey.replaces.last_4anyOf 1stringIm Elternobjekt erforderlich—
apiKey.replaces.statusanyOf 1stringIm Elternobjekt erforderlich
  • enum: ["active","expired","revoked"]
apiKey.replacesanyOf 2nullIm Elternobjekt erforderlich—
apiKey.replaced_byarrayIm Elternobjekt erforderlich—
apiKey.replaced_by[]objectOptional / Element—
apiKey.replaced_by[].idstringIm Elternobjekt erforderlich
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
apiKey.replaced_by[].namestringIm Elternobjekt erforderlich—
apiKey.replaced_by[].last_4stringIm Elternobjekt erforderlich—
apiKey.replaced_by[].statusstringIm Elternobjekt erforderlich
  • enum: ["active","expired","revoked"]
apiKey.capabilitiesarrayOptional / Element—
apiKey.capabilities[]stringOptional / Element
  • enum: ["agent:operate","agent:publish","agent:engage"]
apiKey.workspace_idsarray | nullOptional / Element—
apiKey.workspace_idsanyOf 1arrayOptional / Element—
apiKey.workspace_ids[]anyOf 1stringOptional / Element
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
apiKey.workspace_idsanyOf 2nullOptional / Element—
apiKey.created_by_delegated_grant_idstring | nullOptional / Element—
apiKey.created_by_delegated_grant_idanyOf 1stringOptional / Element
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
apiKey.created_by_delegated_grant_idanyOf 2nullOptional / Element—
secretstringIm Elternobjekt erforderlich
  • minLength: 1
Vollständiges JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "apiKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "name": {
          "type": "string"
        },
        "last_4": {
          "type": "string"
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "revoked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "expired",
            "revoked"
          ]
        },
        "replaces": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                },
                "last_4": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "expired",
                    "revoked"
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "last_4",
                "status"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "replaced_by": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "name": {
                "type": "string"
              },
              "last_4": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "expired",
                  "revoked"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "last_4",
              "status"
            ]
          }
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "agent:operate",
              "agent:publish",
              "agent:engage"
            ]
          }
        },
        "workspace_ids": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "created_by_delegated_grant_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "name",
        "last_4",
        "scopes",
        "created_at",
        "expires_at",
        "last_used_at",
        "revoked_at",
        "status",
        "replaces",
        "replaced_by"
      ]
    },
    "secret": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "apiKey",
    "secret"
  ]
}

Fehler und sichere Wiederholungen

Prüfe HTTP-Status und Antwortinhalt. Ein 400-Validierungsfehler kann einen ZodError enthalten; Handler-Fehler verwenden die Felder error, message und code. Bewahre request_id oder x-request-id zur Diagnose ohne Zugangsdaten auf. Behebe 401/403-Zugriffsfehler vor einem erneuten Versuch und beachte Retry-After bei 429. Ist ein Schreibvorgang ungewiss oder liefert 5xx, lies zuerst das bestehende Ergebnis. Verwende einen Idempotenzschlüssel nur wieder, wo dies unterstützt wird; Wiederholungen unterscheiden sich je nach Operation und garantieren keine genau einmalige Zustellung.

Anleitung zur Fehlerbehebung

Beispiele

Diese Beispiele nutzen anhand der Schemas geprüfte fiktive Werte. Ersetze IDs durch autorisierte IDs, Medien durch bereite Assets und Daten durch bestätigte Veröffentlichungszeiten. Prüfe Kontoeignung vor Schreibvorgängen. Diese Seite sendet keine API-Anfragen.

Setze SOSOAPI_ACCESS_TOKEN auf deinem Server auf akzeptierte Zugangsdaten dieser Operation und halte es aus Browsercode heraus. Für Agenten nutze sosoapi auth login zur Browseranmeldung und lass die CLI Zugangsdaten erneuern.

request.json

{
  "id": "11111111-1111-4111-8111-111111111111"
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/identity-api/api-keys/renew" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/identity-api/api-keys/renew", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "id": "11111111-1111-4111-8111-111111111111"
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /identity-api/api-keys/renew < request.json

Synthetisches Antwortbeispiel

{
  "apiKey": {
    "id": "11111111-1111-4111-8111-111111111111",
    "name": "example",
    "last_4": "example",
    "scopes": [],
    "created_at": "2099-01-15T09:00:00Z",
    "expires_at": null,
    "last_used_at": null,
    "revoked_at": null,
    "status": "active",
    "replaces": null,
    "replaced_by": []
  },
  "secret": "example"
}

MCP: sosoapi_renew_api_key