Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zitadel/client-ruby/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheActionServiceApi provides methods for managing action targets in Zitadel. Targets are webhook endpoints that can be triggered during various events in the authentication and authorization flow.
Initialize the API
Target Management
create_target
create_target
Create a new target to your endpoint, which can be used in executions.Required permission:
action.target.writeThe ID of the created target
delete_target
delete_target
Delete an existing target. This will remove it from any configured execution as well.Required permission:
action.target.deletePublic Key Management (JWE Encryption)
add_public_key
add_public_key
Adds a public key to the target for payload encryption. The key is used when payload type is set to
PAYLOAD_TYPE_JWE.Required permission: action.target.writeThe ID of the target
Public key in PEM format (RSA or EC)
Optional expiration date for the key
activate_public_key
activate_public_key
Activates the public key for payload encryption. Only one key can be active at a time.Required permission:
action.target.writedeactivate_public_key
deactivate_public_key
Deactivates the public key for payload encryption. Use in break-glass scenarios to quickly disable a compromised key.Required permission:
action.target.writeTarget Types
Webhook Target
Standard HTTP webhook endpoint:Request Target
Custom HTTP request with configurable method:Async Target
Asynchronous execution without waiting for response:Payload Types
JSON Payload
Standard JSON payload:JWE Encrypted Payload
Encrypted payload using JWE (JSON Web Encryption):- Add a public key to the target
- Activate the key
- The payload will be encrypted with the active key
- The
kidheader in the JWE token indicates which key was used
Example: Create Webhook with Encryption
Example: Key Rotation
Example: Emergency Key Deactivation
Webhook Payload Structure
When a target is triggered, it receives a payload with information about the event:JSON Payload Example
JWE Payload
Encrypted payloads use JWE compact serialization:- kid header: Indicates which public key was used for encryption
- alg header: Algorithm used (RSA-OAEP-256 or ECDH-ES+A256KW)
- enc header: Content encryption method (A256GCM)
Decrypting JWE Payloads
Target Configuration Options
Display name for the target
URL endpoint for the webhook
Type of target:
TARGET_TYPE_WEBHOOK or TARGET_TYPE_REQUESTRequest timeout (e.g., ”10s”, ”30s”)
Whether to execute asynchronously
Payload format:
PAYLOAD_TYPE_JSON or PAYLOAD_TYPE_JWEWhether to interrupt the flow on target failure
Best Practices
- Use JWE for Sensitive Data: Always encrypt payloads containing PII or sensitive information
- Implement Retry Logic: Your webhook endpoint should handle retries gracefully
- Validate Signatures: Verify that requests are actually from Zitadel
- Monitor Timeouts: Set appropriate timeouts based on your endpoint’s response time
- Key Rotation: Regularly rotate encryption keys and update them before expiration
- Test Async Behavior: Async targets don’t block the auth flow, test accordingly
- Handle Errors: Implement proper error handling and logging in your webhook
Common Use Cases
- User Provisioning: Trigger user creation in external systems
- Audit Logging: Send authentication events to SIEM systems
- Data Synchronization: Keep user data in sync across systems
- Notification: Send alerts on security events
- Compliance: Record authentication events for compliance
See Also
- Session Service - Manage user sessions
- User Service - Manage users and authentication