Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zitadel/zitadel/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This quickstart guide will walk you through making your first API call to ZITADEL. You’ll create a Personal Access Token (PAT) and use it to retrieve user information. Time to complete: ~5 minutesPrerequisites
- A ZITADEL account (Cloud or self-hosted)
- Access to create service accounts
- A terminal with
curlinstalled (or any HTTP client)
Step 1: Create a Service Account
Service accounts are machine users designed for API access.- Log in to your ZITADEL Console
- Navigate to Users in the sidebar
- Switch to the Service Accounts tab
- Click New
- Fill in the details:
- User Name:
quickstart-api - Name:
Quickstart API Service Account - Description:
Service account for API quickstart - Access Token Type: Select Bearer
- User Name:
- Click Create
User ID format: ZITADEL user IDs are numeric strings, e.g.,
178366401571647008Step 2: Create a Personal Access Token
Personal Access Tokens provide quick authentication for API calls.- In your service account details, click on Personal Access Tokens in the left menu
- Click New
- Set an expiration date (e.g., 1 month from now)
- Click Add
- Copy the token immediately and save it securely
Step 3: Set Your Environment Variables
To make the following steps easier, set these environment variables in your terminal:Step 4: Make Your First API Call
Now let’s retrieve the service account information using the User Service API.Get User by ID
Success! You’ve made your first API call to ZITADEL.
Step 5: Try More API Calls
List All Users
Search for users in your instance:Create a New Organization
Get Organization by ID
Using theorganization_id from the creation response:
Understanding the Response
ZITADEL API responses follow consistent patterns:Resource Object
Most responses include a resource object with:- Resource data: The main entity (user, organization, etc.)
- Details: Metadata including
sequence,creationDate,changeDate, andresourceOwner - State: Current state of the resource (e.g.,
USER_STATE_ACTIVE)
Details Object
- sequence: Version number for optimistic locking
- creationDate: When the resource was created
- changeDate: When the resource was last modified
- resourceOwner: The organization ID that owns the resource
Error Handling
If something goes wrong, ZITADEL returns structured errors:- 200: Success
- 400: Bad request (invalid input)
- 401: Unauthenticated (invalid or missing token)
- 403: Forbidden (insufficient permissions)
- 404: Not found (resource doesn’t exist)
- 409: Conflict (resource already exists)
Using Different Tools
HTTPie
Python
JavaScript/Node.js
Go
Next Steps
Now that you’ve made your first API calls, explore more:API Overview
Learn about API design principles and available services
Authentication
Implement production-ready JWT Profile authentication
User Service API
Explore the full User Service API reference
SDKs and Tools
Use official SDKs for easier integration
Troubleshooting
Token not working?
- Verify the token was copied correctly (no extra spaces)
- Check the token hasn’t expired
- Ensure you’re using the correct ZITADEL domain
Permission denied?
- Verify your service account has the necessary roles
- Check that you’re accessing resources in the correct organization
- Ensure the scope includes
urn:zitadel:iam:org:project:id:zitadel:aud
Rate limiting
ZITADEL may rate-limit requests. If you receive a429 Too Many Requests response, implement exponential backoff.
Clean Up
To remove the resources created in this quickstart:-
Delete the Personal Access Token:
- Navigate to your service account
- Go to Personal Access Tokens
- Delete the token you created
-
(Optional) Delete the service account:
- Navigate to Users → Service Accounts
- Select the service account
- Click Delete
- (Optional) Delete the test organization if you created one