PropelAuth · Arazzo Workflow

PropelAuth Rotate User API Key

Version 1.0.0

Find a user's active API key, revoke it, and issue a fresh replacement.

1 workflow 1 source API 1 provider
View Spec View on GitHub AuthenticationIdentityB2BMulti-TenancyAuthorizationRBACSSOSCIMMCPAPI KeysArazzoWorkflows

Provider

propelauth

Workflows

rotate-user-api-key
Revoke a user's existing API key and issue a fresh one in its place.
Resolves a user's most recent active API key, revokes it, and issues a replacement key bound to the same user.
3 steps inputs: backendApiKey, expiresAtSeconds, userId outputs: newKeyId, newKeyToken, revokedKeyId
1
findActiveKey
fetchActiveApiKeys
List the user's active API keys and take the most recent.
2
revokeKey
deleteApiKey
Revoke the user's current API key so the old token stops validating.
3
issueNewKey
createApiKey
Issue a fresh API key bound to the same user.

Source API Descriptions

Arazzo Workflow Specification

propelauth-rotate-user-api-key-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: PropelAuth Rotate User API Key
  summary: Find a user's active API key, revoke it, and issue a fresh replacement.
  description: >-
    A find-then-act key rotation flow. The workflow lists the active API keys for
    a user, deletes the most recent one to revoke it, and issues a new API key
    bound to the same user — returning the new plaintext token, which is only
    shown once. Each step inlines its request, including the Backend Integration
    API key as a bearer token.
  version: 1.0.0
sourceDescriptions:
- name: apiKeysApi
  url: ../openapi/propelauth-api-keys-api-openapi.yml
  type: openapi
workflows:
- workflowId: rotate-user-api-key
  summary: Revoke a user's existing API key and issue a fresh one in its place.
  description: >-
    Resolves a user's most recent active API key, revokes it, and issues a
    replacement key bound to the same user.
  inputs:
    type: object
    required:
    - backendApiKey
    - userId
    properties:
      backendApiKey:
        type: string
        description: PropelAuth Backend Integration API key presented as a bearer token.
      userId:
        type: string
        description: Identifier of the user whose API key should be rotated.
      expiresAtSeconds:
        type: integer
        description: Optional Unix-seconds expiry for the replacement API key.
  steps:
  - stepId: findActiveKey
    description: List the user's active API keys and take the most recent.
    operationId: fetchActiveApiKeys
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.backendApiKey"
    - name: user_id
      in: query
      value: $inputs.userId
    - name: page_size
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentKeyId: $response.body#/api_keys/0/api_key_id
  - stepId: revokeKey
    description: Revoke the user's current API key so the old token stops validating.
    operationId: deleteApiKey
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.backendApiKey"
    - name: apiKeyId
      in: path
      value: $steps.findActiveKey.outputs.currentKeyId
    successCriteria:
    - condition: $statusCode == 200
  - stepId: issueNewKey
    description: Issue a fresh API key bound to the same user.
    operationId: createApiKey
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.backendApiKey"
    requestBody:
      contentType: application/json
      payload:
        user_id: $inputs.userId
        expires_at_seconds: $inputs.expiresAtSeconds
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      newKeyId: $response.body#/api_key_id
      newKeyToken: $response.body#/api_key_token
  outputs:
    revokedKeyId: $steps.findActiveKey.outputs.currentKeyId
    newKeyId: $steps.issueNewKey.outputs.newKeyId
    newKeyToken: $steps.issueNewKey.outputs.newKeyToken